Fix up ownership of db files to repo instead of random user
[girocco/ztw.git] / updatecheck.sh
blob9f30988e852e184f7c67755a3d08f7aabff8d859
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 else
15 /home/repo/repomgr/update.sh "${dir%.git}"
17 done
19 rm /tmp/gitupdatelock