diff --git a/check_process b/check_process index 9255b18..48636c3 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,6 @@ upgrade=1 backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=1 (9001) change_url=1 ;; Test sans mypads diff --git a/scripts/change_url b/scripts/change_url index 131102c..2b55063 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,6 +30,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) mypads=$(ynh_app_setting_get --app=$app --key=mypads) port=$(ynh_app_setting_get --app=$app --key=port) +#================================================= +# BACKUP BEFORE UPGRADE 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 () { + # 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 + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ACTIVATE MAINTENANCE MODE #================================================= diff --git a/scripts/remove b/scripts/remove index 1087332..1415a9b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,7 +28,7 @@ export=$(ynh_app_setting_get --app=$app --key=export) #================================================= # Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status $app >/dev/null 2>&1 +if ynh_exec_fully_quiet yunohost service status $app then ynh_script_progression --message="Removing $app service..." yunohost service remove $app