3 # Git maintenance script, run by cron.
5 # Update symlinks to user git repo locations.
6 find /afs
/hcoop.net
/user
-mindepth 3 -maxdepth 3 -noleaf -exec \
7 sh
-c "test -e {}/.hcoop-git && { \
8 rm -f /var/cache/git/\$(basename {}); \
9 ln -sf {}/.hcoop-git /var/cache/git/\$(basename {}); }" \
; \
12 # Remove symlinks for users that have wrong permissions
14 for user
in $
(ls -1 /var
/cache
/git
); do
15 if ! test -e $
(readlink
/var
/cache
/git
/$user); then
16 rm -f /var
/cache
/git
/$user
19 gitpath
=$
(readlink
/var
/cache
/git
/$user)
20 find -L $gitpath -noleaf -type d \
21 ! -regex '.*/\(refs\|objects\)\(/.*\|$\)' -exec \
22 sh
-c "! { fs la {} | \
23 egrep '^ +system:anyuser .*r' > /dev/null; } && \
24 rm -f /var/cache/git/$user 2>/dev/null" \
; \
28 # Update cache of front page.
29 cache
=/var
/local
/lib
/gitweb
/indexcache.html
30 wget
-q -O $cache.tmp
'http://git.hcoop.net/?nocache=y'
31 if test -s $cache.tmp
; then