From 708d00c7a0c70067b0b39ab1b55acfa8092e40f0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 4 Sep 2022 16:11:02 +0200 Subject: [PATCH] Update restore --- scripts/restore | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/restore b/scripts/restore index b16c175..e012b6c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 export app=$YNH_APP_INSTANCE_NAME @@ -91,11 +91,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -ynh_psql_test_if_first_run - export db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= # PYTHON DEPENDENCIES @@ -118,9 +117,9 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================ +#================================================= # CONFIGURE LOG DIR -#================================================ +#================================================= mkdir -p /var/log/$app chown -R $app /var/log/$app