diff options
Diffstat (limited to 'templates/update.sh.erb')
-rw-r--r-- | templates/update.sh.erb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/templates/update.sh.erb b/templates/update.sh.erb new file mode 100644 index 0000000..e158f58 --- /dev/null +++ b/templates/update.sh.erb @@ -0,0 +1,29 @@ +#!/bin/bash + +NAME="$1" +INSTANCE="$2" +BASE="<%= apache_sites_folder %>" +SITE=$BASE/$NAME +CONF="/etc/ikiwiki" +WEB_OWNER="www-data" +WEB_GROUP="www-data" +REPO_OWNER="gitosis" +REPO_GROUP="gitosis" +REPO="/var/git/repositories/$NAME.git" + +if [ -z "$INSTANCE" ]; then + echo "Usage:`basename $0` <site> <instance>" +fi + +if [ ! -e "$CONF/$NAME" ]; then + echo "No config file for $NAME" +fi + +# Setup +ikiwiki --setup /etc/ikiwiki/$NAME.setup + +# Fix permissions +chown -R $WEB_OWNER.$WEB_GROUP $SITE/"$INSTANCE"_src $SITE/$INSTANCE +chown -R $REPO_OWNER.$REPO_GROUP $REPO +chown $WEB_OWNER.$REPO_GROUP $REPO/hooks/post-update +chown $WEB_OWNER.$REPO_GROUP $SITE/$INSTANCE/ikiwiki.cgi |