From 862635a269550fe74c6a007aa0d92b930b5ef260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 30 Apr 2014 07:51:43 +0200 Subject: add gitolite-mirror.sh --- gitolite-mirror.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 gitolite-mirror.sh diff --git a/gitolite-mirror.sh b/gitolite-mirror.sh new file mode 100755 index 0000000..8dfc857 --- /dev/null +++ b/gitolite-mirror.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +if [ $# -lt 1 ]; then + echo "missing gitolite config file" + exit 1 +fi + +RESET="\033[0m" +GREEN="\033[0;32m" + +GIT_URI=${GIT_URI:-"git://asynk.ch"} +GITOLITE_CONF=$1 + +cat $GITOLITE_CONF | grep '^repo' | sed 's/repo\s\+//' | while read repo; do + echo -e "** >$GREEN$repo$RESET<" + if [ -d "${repo}" ]; then + cd $repo + git remote update --prune + cd .. + else + git clone --mirror $GIT_URI/${repo}.git $repo + fi +done -- cgit v1.1-2-g2b99