hcoop-git-maint: Only update page if new content is nonempty.
[clinton/scripts.git] / hcoop-git-maint
index d148f2a..05e3f37 100755 (executable)
@@ -10,5 +10,9 @@ find /afs/hcoop.net/user -mindepth 3 -maxdepth 3 -noleaf -exec \
 # Update cache of front page.
 cache=/var/local/lib/gitweb/indexcache.html
 wget -q -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
-chmod a+r $cache.tmp
-mv $cache.tmp $cache
+if test -s $cache.tmp; then
+    chmod a+r $cache.tmp
+    mv $cache.tmp $cache
+else
+    rm -f $cache.tmp
+fi