hcoop-git-maint: Only update page if new content is nonempty.
[clinton/scripts.git] / hcoop-git-maint
CommitLineData
f4189f51 1#!/bin/bash
2#
3# Git maintenance script, run by cron.
4
5# Update symlinks to user git repo locations.
6find /afs/hcoop.net/user -mindepth 3 -maxdepth 3 -noleaf -exec \
7 sh -c "test -e {}/.hcoop-git && \
8 ln -s {}/.hcoop-git/ /var/cache/git/\$(basename {}) 2>/dev/null" \;
9
10# Update cache of front page.
11cache=/var/local/lib/gitweb/indexcache.html
df1962e3 12wget -q -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
863f93ee 13if test -s $cache.tmp; then
14 chmod a+r $cache.tmp
15 mv $cache.tmp $cache
16else
17 rm -f $cache.tmp
18fi