aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-07-28 16:34:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-07-28 16:34:36 -0300
commit61bbe6530eaf19bfedb09a923184763e130bf6c9 (patch)
tree4f9075532d9ec4177357358fd1aac8151c2d8e69 /templates
parent39a6de3db7edd8e2089de085683dbeb45a684581 (diff)
downloadpuppet-ikiwiki-61bbe6530eaf19bfedb09a923184763e130bf6c9.tar.gz
puppet-ikiwiki-61bbe6530eaf19bfedb09a923184763e130bf6c9.tar.bz2
Making ikiwiki-refresh to call ikiwiki-deploy if needed
Diffstat (limited to 'templates')
-rw-r--r--templates/deploy.sh.erb12
-rw-r--r--templates/refresh.sh.erb5
2 files changed, 13 insertions, 4 deletions
diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb
index 07760ec..e5bfa92 100644
--- a/templates/deploy.sh.erb
+++ b/templates/deploy.sh.erb
@@ -25,7 +25,8 @@ fi
mkdir -p $SITE/"$INSTANCE"_src/
# Create initial page
-echo > $SITE/"$INSTANCE"_src/index.mdwn <<EOF
+if [ ! -e $SITE/"$INSTANCE"_src/index.mdwn ]; then
+ echo > $SITE/"$INSTANCE"_src/index.mdwn <<EOF
Welcome to your new wiki.
All wikis are supposed to have a [[SandBox]], so this one does too.
@@ -34,11 +35,14 @@ All wikis are supposed to have a [[SandBox]], so this one does too.
This wiki is powered by [ikiwiki](http://ikiwiki.info).
EOF
+fi
# Create ikiwiki instance
-ikiwiki-makerepo git $SITE/"$INSTANCE"_src/ $REPO
-touch $REPO/git-daemon-export-ok
-( cd $REPO/$NAME.git && git --bare update-server-info )
+if [ ! -d "$REPO" ]; then
+ ikiwiki-makerepo git $SITE/"$INSTANCE"_src/ $REPO
+ touch $REPO/git-daemon-export-ok
+ ( cd $REPO/$NAME.git && git --bare update-server-info )
+fi
# Refresh the instance
ikiwiki-refresh $NAME $INSTANCE
diff --git a/templates/refresh.sh.erb b/templates/refresh.sh.erb
index bca18e4..6680f23 100644
--- a/templates/refresh.sh.erb
+++ b/templates/refresh.sh.erb
@@ -21,6 +21,11 @@ if [ ! -e "$CONF/$NAME.setup" ]; then
exit 1
fi
+# Deploy if needed
+if [ ! -d "$REPO" ]; then
+ ikiwiki-deploy $NAME $INSTANCE
+fi
+
# Setup
ikiwiki --setup /etc/ikiwiki/$NAME.setup