#!/bin/bash NAME="$1" INSTANCE="$2" BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" SITE=$BASE/$NAME CONF="/etc/ikiwiki" WEB_OWNER="www-data" WEB_GROUP="www-data" REPO_OWNER="<%= scope.lookupvar('ikiwiki:git_implementation') %>" REPO_GROUP="<%= scope.lookupvar('ikiwiki:git_implementation') %>" REPO="/var/git/repositories/$NAME.git" if [ -z "$INSTANCE" ]; then echo "Usage:`basename $0` " exit 1 fi if [ ! -e "$CONF/$NAME.setup" ]; then echo "No config file for $NAME" exit 1 fi # Deploy if needed if [ ! -d "$REPO" ]; then ikiwiki-deploy $NAME $INSTANCE 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 # Setuid/setgid chmod 6550 $REPO/hooks/post-update chmod 6550 $SITE/$INSTANCE/ikiwiki.cgi