]> git.armaanb.net Git - stagit.git/blobdiff - repo-gen.sh
Fix ownership of generated files.
[stagit.git] / repo-gen.sh
index c68950c4aa16234f09bd98d016c3afc28614959b..afae9305c8ed38a512b67d19e17e0262b1601d27 100755 (executable)
@@ -13,7 +13,7 @@ STAGIT_INDEX=/var/www/git/stagit-index.out
 [ ! -f "$STAGIT_INDEX" ] && STAGIT_INDEX=stagit-index
 
 for repo in /srv/git/*.git; do
-       repo="$(basename "$repo" | cut -f 1 -d '.')"
+       repo="$(basename "$repo" | rev | cut -c 5- | rev)"
 
        [ "$fresh" = true ] \
                && echo "Deleting HTML for $repo." \
@@ -34,3 +34,7 @@ done
 
 echo "Generating index.html with \`$STAGIT_INDEX\`."
 "$STAGIT_INDEX" /srv/git/*.git > /var/www/git/index.html
+
+# Correct ownership of the web files.
+chowm git:www-data -R /var/www/git -f
+chmod         g+rw -R /var/www/git -f