From 98ed130c1b5d86f878cee5f1e2968b84b28e63a9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Nov 2016 12:36:01 +0000 Subject: [PATCH] Backup and restore password storage state --- src/freedombone-backup-local | 7 +++++++ src/freedombone-backup-remote | 7 +++++++ src/freedombone-restore-local | 10 ++++++++++ src/freedombone-restore-remote | 10 ++++++++++ 4 files changed, 34 insertions(+) diff --git a/src/freedombone-backup-local b/src/freedombone-backup-local index 279982eb..fee4617c 100755 --- a/src/freedombone-backup-local +++ b/src/freedombone-backup-local @@ -250,6 +250,13 @@ function backup_configfiles { if [ -f $NODEJS_INSTALLED_APPS_FILE ]; then cp -f $NODEJS_INSTALLED_APPS_FILE $temp_backup_dir fi + if [ -f /root/.nostore ]; then + cp -f /root/.nostore $temp_backup_dir + else + if [ -f $temp_backup_dir/.nostore ]; then + rm $temp_backup_dir/.nostore + fi + fi cp -f $CONFIGURATION_FILE $temp_backup_dir cp -f $COMPLETION_FILE $temp_backup_dir if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then diff --git a/src/freedombone-backup-remote b/src/freedombone-backup-remote index 2507f3ab..518492da 100755 --- a/src/freedombone-backup-remote +++ b/src/freedombone-backup-remote @@ -114,6 +114,13 @@ function backup_configfiles { if [ -f $NODEJS_INSTALLED_APPS_FILE ]; then cp -f $NODEJS_INSTALLED_APPS_FILE $temp_backup_dir fi + if [ -f /root/.nostore ]; then + cp -f /root/.nostore $temp_backup_dir + else + if [ -f $temp_backup_dir/.nostore ]; then + rm $temp_backup_dir/.nostore + fi + fi cp -f $CONFIGURATION_FILE $temp_backup_dir cp -f $COMPLETION_FILE $temp_backup_dir if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then diff --git a/src/freedombone-restore-local b/src/freedombone-restore-local index 1917e7c8..c5fdd49a 100755 --- a/src/freedombone-restore-local +++ b/src/freedombone-restore-local @@ -105,6 +105,16 @@ function restore_configfiles { temp_restore_dir=/root/tempconfig restore_directory_from_usb $temp_restore_dir configfiles + if [ -f $temp_restore_dir/root/.nostore ]; then + if [ ! -f /root/.nostore ]; then + touch /root/.nostore + fi + else + if [ -f /root/.nostore ]; then + rm /root/.nostore + fi + fi + if [ -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE ]; then cp -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE $NODEJS_INSTALLED_APPS_FILE fi diff --git a/src/freedombone-restore-remote b/src/freedombone-restore-remote index 14d0d626..04e7ae22 100755 --- a/src/freedombone-restore-remote +++ b/src/freedombone-restore-remote @@ -112,6 +112,16 @@ function restore_configfiles { temp_restore_dir=/root/tempconfig restore_directory_from_friend $temp_restore_dir configfiles + if [ -f $temp_restore_dir/root/.nostore ]; then + if [ ! -f /root/.nostore ]; then + touch /root/.nostore + fi + else + if [ -f /root/.nostore ]; then + rm /root/.nostore + fi + fi + if [ -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE ]; then cp -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE $NODEJS_INSTALLED_APPS_FILE fi