1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash if [ "$2" == "" ]; then echo usage: mkgit-server [repository name] [git user] [-d] echo " -d; edit the description file instead" exit fi if [ "$3" == "-d" ]; then $EDITOR /home/$2/$1.git/description exit fi mkdir /home/$2/$1.git cd /home/$2/$1.git git init --bare echo "This is the description of the Repo" > description $EDITOR description chown -R $2 * cd .. chown -R $2 $1.git