From 5f8062481c3efc66a663b08053d664275906c4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:42:25 +0200 Subject: [PATCH] cleaning --- scripts/install | 5 ----- scripts/remove | 14 ++------------ scripts/restore | 27 +++++++++++---------------- scripts/upgrade | 7 +------ 4 files changed, 14 insertions(+), 39 deletions(-) diff --git a/scripts/install b/scripts/install index e179a35..ff16f71 100755 --- a/scripts/install +++ b/scripts/install @@ -46,11 +46,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 - # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint diff --git a/scripts/remove b/scripts/remove index 60e7d08..1e9f012 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,26 +10,16 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE LOGROTATE CONFIGURATION +# REMOVE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index 1d83cb2..523063b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -38,13 +29,6 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory chown -R $app:www-data "$data_dir" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -52,6 +36,17 @@ ynh_script_progression --message="Restoring the MySQL database..." --weight=1 ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3df9c7a..0efe0a5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,7 +66,7 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" # Update database -cd "$install_dir" && ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 console.php database:update +(cd "$install_dir" && ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 console.php database:update) #================================================= # NGINX CONFIGURATION @@ -76,11 +76,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 - # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint