From e21701c240354138b15b3c164b612d13ce00debc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Jul 2021 19:44:30 +0200 Subject: [PATCH] Cleaning up --- scripts/backup | 3 ++- scripts/change_url | 17 ++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/backup b/scripts/backup index a446a3e..3166fda 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -39,7 +40,7 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" #================================================= -# BACKUP NGINX CONFIGURATION +# BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/change_url b/scripts/change_url index e561950..5db8dbf 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,17 +31,19 @@ mypads=$(ynh_app_setting_get --app=$app --key=mypads) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=40 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + # Clean installation remainings that are not handled by the remove script. + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -72,17 +74,6 @@ then change_path=1 fi -#================================================= -# MANAGE FAILURE OF THE SCRIPT -#================================================= - -ynh_clean_setup () { -# Clean installation remainings that are not handled by the remove script. - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD MODIFICATIONS #=================================================