]> gitweb.fluxo.info Git - hydra.git/commitdiff
Support for restore method
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 20:29:01 +0000 (17:29 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 20:29:01 +0000 (17:29 -0300)
lib/hydra/backup
share/hydractl/backup-restore-site

index 210139b09be141c618aecf619f8e27a073950853..260446d6a6eb3cee12221585aa855d151b9f2bd6 100644 (file)
@@ -36,10 +36,7 @@ function hydra_backup_environment {
       exit 1 
     fi
   else
-    if [ "$METHOD" == "restore" ]; then
-      echo "Invalid backup method 'restore'"
-      exit 1
-    elif [ -d "$BACKUPDIR/$METHOD" ]; then
+    if [ -d "$BACKUPDIR/$METHOD" ]; then
       BACKUPDIR="$BACKUPDIR/$METHOD"
     else
       echo "Backup folder for $METHOD not found at $BACKUPDIR"
index bf68779abf5c89ba5fd2ef52f6319f0ee909755b..16ebf932b2911b2526ec9a7aeab5c199f56759a2 100755 (executable)
@@ -8,7 +8,7 @@
 source $APP_BASE/lib/hydra/functions || exit 1
 hydra_config_load
 
-SITE="$3"
+SITE="$2"
 SITES="/var/sites"
 FOLDER="$SITES/$SITE"
 
@@ -17,7 +17,7 @@ if [ -z "$SITE" ]; then
   exit 1
 fi
 
-hydra_backup_environment $*
+hydra_backup_environment $1 restore
 
 # Check if folder exist on the backup
 if [ ! -d "$RESTOREDIR/$FOLDER" ]; then