From 1764a32911ecd01a04a0d4ac515984a95a9f7f90 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 20 Oct 2016 17:01:13 +0100 Subject: [PATCH] Restoring individual apps --- src/freedombone-restore-local | 4 ++-- src/freedombone-utils-backup | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/freedombone-restore-local b/src/freedombone-restore-local index 8d366462..c2ca8cc2 100755 --- a/src/freedombone-restore-local +++ b/src/freedombone-restore-local @@ -101,7 +101,7 @@ function restore_directory_from_usb { function restore_configuration { if [[ $RESTORE_APP != 'all' ]]; then - if [[ $RESTORE_APP != 'configuration' ]]; then + if [[ $RESTORE_APP != 'config' ]]; then return fi fi @@ -715,7 +715,7 @@ restore_certs restore_personal_settings restore_mailing_list restore_email -restore_apps local +restore_apps local $RESTORE_APP set_user_permissions backup_unmount_drive diff --git a/src/freedombone-utils-backup b/src/freedombone-utils-backup index cb75411b..6faae82a 100755 --- a/src/freedombone-utils-backup +++ b/src/freedombone-utils-backup @@ -388,6 +388,7 @@ function backup_apps { function restore_apps { localremote=$1 + RESTORE_APP=$2 RESTORE_APPS_COMPLETED=() @@ -396,12 +397,22 @@ function restore_apps { for app_name in "${APPS_INSTALLED_NAMES[@]}" do - echo $"Restoring ${app_name}" - app_load_variables ${app_name} - function_check restore_${localremote}_${app_name} - restore_${localremote}_${app_name} - RESTORE_APPS_COMPLETED+=("${app_name}") - echo $"Restored ${app_name}" + confirm_restore= + if [ ! $2 ]; then + confirm_restore=1 + else + if [[ "$RESTORE_APP" == "$app_name" ]]; then + confirm_restore=1 + fi + fi + if [ $confirm_restore ]; then + echo $"Restoring ${app_name}" + app_load_variables ${app_name} + function_check restore_${localremote}_${app_name} + restore_${localremote}_${app_name} + RESTORE_APPS_COMPLETED+=("${app_name}") + echo $"Restored ${app_name}" + fi done }