]> gitweb.fluxo.info Git - hydra.git/commitdiff
Support for ikiwiki on backup-restore-site
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Sep 2011 03:27:47 +0000 (00:27 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Sep 2011 03:27:47 +0000 (00:27 -0300)
share/hydractl/backup-restore-site

index dddc3c0af76257f9300b8ee02732cbe28319b606..81de76d056a86a6fb9a8fd2828bc56651f9d9b8e 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # Restore a website from backup
 #
-# TODO: moin, ikiwiki, etc
+# TODO: moin
 
 # Load.
 source $APP_BASE/lib/hydra/functions || exit 1
@@ -100,3 +100,16 @@ if [ -f "$RESTOREDIR/var/backups/mysql/sqldump/$SITE.sql.gz" ]; then
 else
   echo "Databases should be manually restored"
 fi
+
+# Ikiwiki
+if [ -e "$FOLDER/ikiwiki" ]; then
+  echo "Restoring ikiwiki for $SITE..."
+  file="/etc/ikiwiki/$SITE.setup"
+  if [ -e "$file" ] && [ -e "/var/git/repositories/$SITE" ]; then
+    site="`basename $file .setup`"
+    git clone file:///var/git/repositories/$SITE /var/sites/$SITE/ikiwiki_src
+    ikiwiki --setup $file --rebuild
+  else
+    echo "Either $file or git repository not found for $SITE ikiwiki instance"
+  fi
+fi