From e9ea6b48a53ff8a2cd7f3d98aa23052f62b82096 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 10 Jan 2022 22:07:00 +0100 Subject: [PATCH] Handle no PHP in restore script --- scripts/restore | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index 0062b46..b0629dd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,9 +45,13 @@ test ! -d $final_path \ #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=2 -ynh_install_app_dependencies "php${phpversion}-fpm" +if [ $phpversion != "none" ] +then + ynh_script_progression --message="Reinstalling dependencies..." --weight=2 + + ynh_install_app_dependencies "php${phpversion}-fpm" +fi #================================================= # RESTORE THE NGINX CONFIGURATION @@ -107,7 +111,10 @@ chmod o-rwx "$final_path" # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" +if [ $phpversion != "none" ] +then + ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" +fi #================================================= # SPECIFIC RESTORATION @@ -120,7 +127,11 @@ ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload +if [ $phpversion != "none" ] +then + ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload +fi + ynh_systemd_action --service_name=nginx --action=reload #=================================================