Fix unsifficient number of ../s in alternates setup
[girocco/ztw.git] / updatecheck.sh
blob180aa6967d4ad32b61ccfa2b46cb33b0b69f5814
1 #!/bin/bash
3 if [ -e /tmp/gitupdatelock ]; then
4 echo "Locked!" >&2
5 exit 1
6 fi
7 touch /tmp/gitupdatelock
9 cd /srv/git
10 find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' |
11 while read dir; do
12 if [ -e "$dir"/.nofetch ]; then
13 (cd "$dir/objects" && [ "$(ls ?? 2>/dev/null)" ] && GIT_DIR=".." git repack -a -d)
14 GIT_DIR="$dir" git update-server-info
15 else
16 /home/repo/repomgr/update.sh "${dir%.git}"
18 done
20 rm /tmp/gitupdatelock