Backup and restore password storage state

This commit is contained in:
Bob Mottram 2016-11-23 12:36:01 +00:00
parent 1b0820bf46
commit 98ed130c1b
4 changed files with 34 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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