aboutsummaryrefslogtreecommitdiff
path: root/templates/refresh.sh.erb
diff options
context:
space:
mode:
Diffstat (limited to 'templates/refresh.sh.erb')
-rw-r--r--templates/refresh.sh.erb23
1 files changed, 12 insertions, 11 deletions
diff --git a/templates/refresh.sh.erb b/templates/refresh.sh.erb
index fbf1dfd..10b96c1 100644
--- a/templates/refresh.sh.erb
+++ b/templates/refresh.sh.erb
@@ -5,15 +5,16 @@
# Parameters
NAME="$1"
-WEB_OWNER="$2"
-WEB_GROUP="$3"
-WWW_USER="<%= scope.lookupvar('ikiwiki::www_user') %>"
-BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
+OWNER="$2"
+GROUP="$3"
SITE="$BASE/$NAME"
CONF="/etc/ikiwiki"
INSTANCE="ikiwiki"
+WWW_USER="<%= scope.lookupvar('ikiwiki::www_user') %>"
+BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>"
REPO_GROUP="<%= scope.lookupvar('ikiwiki::git_implementation') %>"
+REPO="/var/git/repositories/$NAME.git"
# Syntax check
if [ -z "$INSTANCE" ]; then
@@ -26,19 +27,19 @@ fi
# Deploy if needed
if [ ! -d "$REPO" ]; then
- ikiwiki-deploy $NAME $WEB_OWNER $WEB_GROUP
+ ikiwiki-deploy $NAME $OWNER $GROUP
fi
# Setup
ikiwiki --setup /etc/ikiwiki/$NAME.setup
# Fix permissions
-chown -R $REPO_OWNER. $REPO
-chown -R $WEB_OWNER.$WEB_GROUP $SITE/"$INSTANCE"_src $SITE/$INSTANCE
-chown $WEB_OWNER.$WWW_USER $SITE/$INSTANCE/ikiwiki.cgi
-chmod 6550 $SITE/$INSTANCE/ikiwiki.cgi
-chown $WEB_OWNER.$REPO $REPO/hooks/post-update
-chmod 6550 $REPO/hooks/post-update
+chown -R $REPO_OWNER. $REPO
+chown -R $OWNER.$GROUP $SITE/"$INSTANCE"_src $SITE/$INSTANCE
+chown $OWNER.$WWW_USER $SITE/$INSTANCE/ikiwiki.cgi
+chmod 6550 $SITE/$INSTANCE/ikiwiki.cgi
+chown $OWNER.$REPO $REPO/hooks/post-update
+chmod 6550 $REPO/hooks/post-update
# Setuid/setgid
chmod 0755 $REPO/hooks/post-update