Skip to content
Snippets Groups Projects
Commit 690906fc authored by Bob Mottram's avatar Bob Mottram
Browse files

dir missing

parent b479b2b6
No related branches found
No related tags found
No related merge requests found
......@@ -544,17 +544,17 @@ function restore_database {
echo $"Restoring ${restore_app_name} database"
local_database_dir=/root/temp${restore_app_name}data
function_check restore_directory_from_usb
restore_directory_from_usb "${local_database}" "${restore_app_name}data"
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
echo $"Unable to restore ${restore_app_name} database"
rm -rf ${local_database}
rm -rf ${local_database_dir}
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit 503
fi
mysqlsuccess=$(mysql -u root --password="$DATABASE_PASSWORD" ${restore_app_name} -o < ${local_database}/${RESTORE_SUBDIR}/temp${restore_app_name}data/${restore_app_name}.sql)
mysqlsuccess=$(mysql -u root --password="$DATABASE_PASSWORD" ${restore_app_name} -o < ${local_database_dir}/${RESTORE_SUBDIR}/temp${restore_app_name}data/${restore_app_name}.sql)
if [ ! "$?" = "0" ]; then
echo "$mysqlsuccess"
function_check set_user_permissions
......@@ -563,8 +563,8 @@ function restore_database {
backup_unmount_drive
exit 964
fi
shred -zu ${local_database}/${RESTORE_SUBDIR}/temp${restore_app_name}data/*
rm -rf ${local_database}
shred -zu ${local_database_dir}/${RESTORE_SUBDIR}/temp${restore_app_name}data/*
rm -rf ${local_database_dir}
echo $"Restoring ${restore_app_name} installation"
if [ ! -d /root/temp${restore_app_name} ]; then
mkdir /root/temp${restore_app_name}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment