ca-install: support multiple webservers, update for new servers
[hcoop/scripts.git] / hcoop-git-maint
index bf4b278..d755f79 100755 (executable)
@@ -6,7 +6,8 @@
 find /afs/hcoop.net/user -mindepth 3 -maxdepth 3 -noleaf -exec \
      sh -c "test -e {}/.hcoop-git && { \
          rm -f /var/cache/git/\$(basename {}); \
-         ln -sf {}/.hcoop-git /var/cache/git/\$(basename {}); }" \;
+         ln -sf {}/.hcoop-git /var/cache/git/\$(basename {}); }" \; \
+     > /dev/null 2>&1
 
 # Remove symlinks for users that have wrong permissions
 IFS=$'\n'
@@ -17,15 +18,16 @@ for user in $(ls -1 /var/cache/git); do
     fi
     gitpath=$(readlink /var/cache/git/$user)
     find -L $gitpath -noleaf -type d \
-        ! -regex '.*/\(refs\|objects\)\(/.*\|$\)' -exec \
+        -regex '.*/\(refs\|objects\|hooks\)\(/.*\|$\)' -prune -o -exec \
         sh -c "! { fs la {} | \
                    egrep '^ +system:anyuser .*r' > /dev/null; } && \
-               rm -f /var/cache/git/$user 2>/dev/null" \;
+               rm -f /var/cache/git/$user 2>/dev/null" \; #\
+        > /dev/null 2>&1
 done
 
 # Update cache of front page.
 cache=/var/local/lib/gitweb/indexcache.html
-wget -q -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
+wget -q --timeout 30 -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
 if test -s $cache.tmp; then
     chmod a+r $cache.tmp
     mv $cache.tmp $cache