Remove restore directory if it exists

This commit is contained in:
Bob Mottram 2017-06-25 13:17:30 +01:00
parent e18eb98ded
commit f04afc2a39
1 changed files with 3 additions and 0 deletions

View File

@ -562,6 +562,9 @@ function restore_database {
if [ -d $USB_MOUNT/backup/${restore_app_name} ]; then
echo $"Restoring ${restore_app_name} database"
local_database_dir=/root/temp${restore_app_name}data
if [ -d ${local_database_dir} ]; then
rm -rf ${local_database_dir}
fi
function_check restore_directory_from_usb
restore_directory_from_usb "${local_database_dir}" "${restore_app_name}data"
if [ ! -f /root/temp${restore_app_name}data/${RESTORE_SUBDIR}/temp${restore_app_name}data/${restore_app_name}.sql ]; then