X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-new-project%2Fid-new-project.sh;h=89d190b15fd80b34aaa32d79e683dc474513351b;hb=6817155c05a3e45325456c260520451022601117;hp=803622e1deaf722b061dd443992e04bc9d3a43da;hpb=c4176b4b36f9c611060ab39e331fb15c9acaa92c;p=git-tools-moved-to-github.git diff --git a/id-new-project/id-new-project.sh b/id-new-project/id-new-project.sh index 803622e..89d190b 100755 --- a/id-new-project/id-new-project.sh +++ b/id-new-project/id-new-project.sh @@ -1,6 +1,7 @@ #!/bin/sh usage() { + echo "" echo "Usage:" echo "id-new-project.sh srcdir description {pub/private}" echo "For example:" @@ -12,9 +13,10 @@ SRC=$1 DESC=$2 TYPE=$3 -if test -z "${TYPE}"; then - usage -fi +case "${TYPE}" in + pub | private) ;; + * ) echo "invalid type: '$TYPE', use pub or private"; usage ;; +esac if test ! -e post-receive; then echo "file post-receive must be in the current directory" @@ -39,7 +41,7 @@ if git clone --bare $SRC ${PROJ}.git; then chmod +x hooks/post-receive git config hooks.mailinglist gitid@indexdata.dk cd .. - scp -r ${PROJ}.git git.indexdata.com:/home/git/${TYPE} - ssh git.indexdata.com "cd /home/git/${TYPE}/${PROJ}.git && chmod -R g+w . && chgrp -R git . && find . -type d | xargs chmod g+s" + scp -P 222 -r ${PROJ}.git git.indexdata.com:/home/git/${TYPE} + ssh -p 222 git.indexdata.com "cd /home/git/${TYPE}/${PROJ}.git && chmod -R g+w . && chgrp -R git . && find . -type d | xargs chmod g+s" fi