diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-04-11 20:42:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-04-11 20:42:53 -0300 |
commit | ff2ef8f403968e16d662676f4dfbbdd991270804 (patch) | |
tree | 5dd3cfcf3fccd140fc0538f4fdbe552a2cc00490 | |
parent | 4f700f3d5e447325fda5d607e9d713c3880cfd2b (diff) | |
download | puppet-ikiwiki-ff2ef8f403968e16d662676f4dfbbdd991270804.tar.gz puppet-ikiwiki-ff2ef8f403968e16d662676f4dfbbdd991270804.tar.bz2 |
More cleanup
-rw-r--r-- | templates/deploy.sh.erb | 8 | ||||
-rw-r--r-- | templates/refresh.sh.erb | 23 |
2 files changed, 16 insertions, 15 deletions
diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb index edcae12..e895546 100644 --- a/templates/deploy.sh.erb +++ b/templates/deploy.sh.erb @@ -5,12 +5,12 @@ # Parameters NAME="$1" -WEB_OWNER="$2" -WEB_GROUP="$3" -INSTANCE="ikiwiki" -BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" +OWNER="$2" +GROUP="$3" SITE=$BASE/$NAME +INSTANCE="ikiwiki" CONF="/etc/ikiwiki" +BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>" REMOTE="$REPO_OWNER@localhost:$NAME" REPO="/var/git/repositories/$NAME.git" 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 |