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

Check that database backup exists

parent 57cc4001
No related branches found
No related tags found
No related merge requests found
......@@ -169,9 +169,7 @@ function restore_local_rss {
function_check get_mariadb_password
get_mariadb_password
function_check rss_create_database
rss_create_database
function_check restore_database
restore_database ttrss
if [ -d /etc/share/tt-rss ]; then
......@@ -252,10 +250,6 @@ function restore_remote_rss {
get_mariadb_password
function_check restore_database_from_friend
function_check rss_create_database
rss_create_database
restore_database_from_friend ttrss
if [ -d /etc/share/tt-rss ]; then
......
......@@ -583,7 +583,7 @@ function restore_database_from_friend {
DATABASE_PASSWORD=
RESTORE_SUBDIR="root"
if [ -d $SERVER_DIRECTORY/backup/${1} ]; then
if [ -d $SERVER_DIRECTORY/backup/${1}data ]; then
database_file_extension='sql'
if [ $USE_MONGODB ]; then
database_file_extension='mdb'
......@@ -666,6 +666,9 @@ function restore_database_from_friend {
fi
fi
fi
else
echo $"No database backup found for ${1}"
exit 6239353
fi
}
......@@ -674,7 +677,7 @@ function restore_database {
restore_app_name=$1
restore_app_domain=$2
if [ -d $USB_MOUNT/backup/${restore_app_name} ]; then
if [ -d $USB_MOUNT/backup/${restore_app_name}data ]; then
echo $"Restoring ${restore_app_name} database"
local_database_dir=/root/temp${restore_app_name}data
if [ -d ${local_database_dir} ]; then
......@@ -776,6 +779,9 @@ function restore_database {
fi
fi
fi
else
echo $"No database backup found for ${restore_app_name}"
exit 7357224
fi
}
......
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