From 158bd8a1fb393ad820028b360db0a6a533cdeb96 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 31 Dec 2023 10:20:32 +0100 Subject: [PATCH] cleaning --- scripts/remove | 8 +++++++- scripts/restore | 9 ++++++--- scripts/upgrade | 5 ++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/remove b/scripts/remove index d6a8c41..427536a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -3,7 +3,13 @@ source _common.sh source /usr/share/yunohost/helpers -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +#================================================= +# REMOVE SYSTEM CONFIGURATIONS +#================================================= +# REMOVE SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 + if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." diff --git a/scripts/restore b/scripts/restore index 0e06b86..d3010c5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,15 +36,18 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql -#================================================= -# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=10 + ynh_script_progression --message="Reinstalling system configurations..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 5be713f..fe2ddc7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,7 +92,10 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_script_progression --message="Upgrading system configurations..." +#================================================= +# REAPPLY SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config