create_new_pub.sh (624B)
1 #!/bin/sh 2 3 REPO_NAME=$1 4 REPO_PATH="${REPO_NAME}.git" 5 CUR_PATH=$(pwd) 6 BASE_URL="git://bsandro.tech/${REPO_NAME}" 7 8 if test -d $REPO_PATH; then 9 echo "Repository ${REPO_PATH} already exists, exiting" 10 exit 11 fi 12 13 echo "creating new public repo ${REPO_NAME}" 14 15 echo -n "Description: " 16 read DESCRIPTION 17 18 echo -n "Owner: " 19 read OWNER 20 21 git init --bare "${REPO_PATH}" 22 echo "${BASE_URL}" > "${REPO_PATH}/url" 23 echo "${DESCRIPTION}" > "${REPO_PATH}/description" 24 echo "${OWNER}" > "${REPO_PATH}/owner" 25 echo "${REPO_PATH}" >> pub.txt 26 touch "${REPO_PATH}/git-daemon-export-ok" 27 ln -s ${CUR_PATH}/post-receive "${REPO_PATH}/hooks/post-receive"