dir missing
This commit is contained in:
parent
b479b2b61e
commit
690906fc23
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue