Check files

This commit is contained in:
Bob Mottram 2016-10-20 17:24:23 +01:00
parent dde8e0fcf3
commit 7f970fe02c
2 changed files with 32 additions and 22 deletions

View File

@ -112,24 +112,29 @@ function restore_configuration {
temp_restore_dir=/root/tempconfig temp_restore_dir=/root/tempconfig
restore_directory_from_usb $temp_restore_dir config restore_directory_from_usb $temp_restore_dir config
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
if [ ! "$?" = "0" ]; then cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
set_user_permissions if [ ! "$?" = "0" ]; then
backup_unmount_drive set_user_permissions
rm -rf $temp_restore_dir backup_unmount_drive
exit 5294 rm -rf $temp_restore_dir
exit 5294
fi
fi fi
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
# install according to the config file # install according to the config file
freedombone -c $CONFIGURATION_FILE freedombone -c $CONFIGURATION_FILE
fi fi
cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE if [ -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt ]; then
if [ ! "$?" = "0" ]; then cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
set_user_permissions if [ ! "$?" = "0" ]; then
backup_unmount_drive set_user_permissions
rm -rf $temp_restore_dir backup_unmount_drive
exit 6382 rm -rf $temp_restore_dir
exit 6382
fi
fi fi
if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then

View File

@ -119,22 +119,27 @@ function restore_configuration {
temp_restore_dir=/root/tempconfig temp_restore_dir=/root/tempconfig
restore_directory_from_friend $temp_restore_dir config restore_directory_from_friend $temp_restore_dir config
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
if [ ! "$?" = "0" ]; then cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
unmount_drive if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir unmount_drive
exit 5372 rm -rf $temp_restore_dir
exit 5372
fi
fi fi
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
# install according to the config file # install according to the config file
freedombone -c $CONFIGURATION_FILE freedombone -c $CONFIGURATION_FILE
fi fi
cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE if [ -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt ]; then
if [ ! "$?" = "0" ]; then cp -f $temp_restore_dir/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
unmount_drive if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir unmount_drive
exit 7252 rm -rf $temp_restore_dir
exit 7252
fi
fi fi
if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then if [ -f ${temp_restore_dir}${BACKUP_EXTRA_DIRECTORIES} ]; then