fi
cd /srv/git
-mkdir "$REPO"
-cd "$REPO"
+mkdir "$REPO" && cd "$REPO"
git init --bare
-echo "#!/bin/sh" >> hooks/post-receive
-echo 'git cat-file blob HEAD:README.md | markdown > $GIT_DIR/README.html' >> hooks/post-receive
+
+cat << EOF > hooks/post-receive
+#!/bin/sh
+git cat-file blob HEAD:README.md | markdown > $GIT_DIR/README.html
+EOF
+
chmod +x hooks/post-receive
touch git-daemon-export-ok
echo "Created $REPO"