+#!/bin/sh
+
+fresh=false
+
+for arg in "$@"; do
+ [ "$arg" = "--fresh" ] && fresh=true
+done
+
+for repo in /srv/git/*.git; do
+ repo="$(basename "$repo" | cut -f 1 -d '.')"
+
+ [ "$fresh" = true ] \
+ && echo "Deleting HTML for $repo." \
+ && rm -fr "/var/www/git/$repo"
+ mkdir -p "/var/www/git/$repo"
+ cd "/var/www/git/$repo"
+
+ [ ! -f style.css ] && ln -s ../style.css ./
+ [ ! -f favicon.png ] && ln -s ../favicon.png ./
+ [ ! -f logo.png ] && ln -s ../logo.png ./
+
+ echo "git://git.knutsen.co/$repo" > "/srv/git/$repo.git/url"
+
+ stagit "/srv/git/$repo.git"
+done
+
+stagit-index /srv/git/*.git > /var/www/git/index.html