From aa72e12555b01b466781a434168fc5db2fb99fb9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Jul 2021 13:22:15 +0200 Subject: [PATCH] Update restore --- scripts/restore | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/restore b/scripts/restore index fa6436d..a119402 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,6 +26,7 @@ domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) final_path=$(ynh_app_setting_get $app final_path) db_name=$(ynh_app_setting_get $app db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -83,8 +84,8 @@ chown -R $app $final_path/{includes,files,upload} # RESTORE OF THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" -ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" +ynh_restore_file "/etc/php$phpversion/fpm/pool.d/$app.conf" +ynh_restore_file "/etc/php$phpversion/fpm/conf.d/20-$app.ini" #================================================= # SPECIFIC RESTORE @@ -99,16 +100,17 @@ chown -R $app "/etc/$app/sk.php" # RESTORE CRON FILE #================================================= -ynh_restore_file "/etc/cron.d/$app" +ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # GENERIC FINALISATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 -ynh_system_reload --service_name=php5-fpm -ynh_system_reload --service_name=nginx +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload +ynh_systemd_action --service_name=nginx --action=reload #================================================= # DEACTIVE MAINTENANCE MODE