Remote restore of configuration files
This commit is contained in:
parent
4cae6b24ce
commit
5df28375eb
|
@ -231,13 +231,13 @@ function restore_configuration {
|
|||
if [ -d $USB_MOUNT/backup/config ]; then
|
||||
echo $"Restoring configuration files"
|
||||
restore_directory_from_usb /root/tempconfig config
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg /homeroot/${PROJECT_NAME}.cfg
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
unmount_drive
|
||||
rm -rf /root/tempconfig
|
||||
exit 5294
|
||||
fi
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}-completed.txt /root/${PROJECT_NAME}-completed.txt
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
unmount_drive
|
||||
rm -rf /root/tempconfig
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
PROJECT_NAME='freedombone'
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
|
||||
export TEXTDOMAIN=${PROJECT_NAME}-restore-remote
|
||||
export TEXTDOMAINDIR="/usr/share/locale"
|
||||
|
@ -135,6 +136,25 @@ function restore_database_from_friend {
|
|||
fi
|
||||
}
|
||||
|
||||
# Restore configuration files
|
||||
if [ -d $SERVER_DIRECTORY/backup/config ]; then
|
||||
echo $"Restoring configuration files"
|
||||
restore_directory_from_friend /root/tempconfig config
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}.cfg $CONFIG_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
unmount_drive
|
||||
rm -rf /root/tempconfig
|
||||
exit 5372
|
||||
fi
|
||||
cp -f /root/tempconfig/root/${PROJECT_NAME}-completed.txt $COMPLETION_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
unmount_drive
|
||||
rm -rf /root/tempconfig
|
||||
exit 7252
|
||||
fi
|
||||
rm -rf /root/tempconfig
|
||||
fi
|
||||
|
||||
# Restore MariaDB
|
||||
if [ -d $SERVER_DIRECTORY/backup/mariadb ]; then
|
||||
echo $"Restoring MariaDB settings"
|
||||
|
|
Loading…
Reference in New Issue