From 33b73919f61da021087361a1736d2c892c79fa78 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 8 Apr 2023 09:34:35 +0200 Subject: [PATCH] cleaning --- scripts/install | 12 ------------ scripts/remove | 12 ------------ scripts/restore | 24 +++++++----------------- 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/scripts/install b/scripts/install index 29092f6..8bc9dc3 100755 --- a/scripts/install +++ b/scripts/install @@ -38,21 +38,9 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# SETUP A CRON -#================================================= -ynh_script_progression --message="Setuping a cron..." --weight=1 - ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" diff --git a/scripts/remove b/scripts/remove index 3242cce..a18a484 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,21 +17,9 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # 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 -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index a242a22..71a355d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,21 +20,6 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=2 - -# Restore the file first, so it can have a backup if different -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -43,9 +28,14 @@ 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 VARIOUS FILES +# RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring various files..." --weight=1 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=2 + +# Restore the file first, so it can have a backup if different +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" ynh_restore_file --origin_path="/etc/cron.d/$app" chown root: "/etc/cron.d/$app"