From e5ec9b4a423b4cc770f33cd23a7d2f1fabffc2c4 Mon Sep 17 00:00:00 2001 From: maniack Date: Mon, 9 Dec 2019 18:12:34 +0100 Subject: [PATCH] Update to last standard --- check_process | 2 -- scripts/change_url | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index a039cd8..ae40e3b 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,6 @@ upgrade=1 from_commit=cbb74263e33deb0ec36f99886a2f773e36d40fd9 backup_restore=1 multi_instance=1 - incorrect_path=1 port_already_use=0 change_url=1 ;; Test avec multisite @@ -37,7 +36,6 @@ upgrade=1 backup_restore=1 multi_instance=1 - incorrect_path=0 port_already_use=0 change_url=0 ;;; Levels diff --git a/scripts/change_url b/scripts/change_url index 5c7502d..3ba81c0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -35,6 +35,23 @@ then ynh_die --message="https://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite" fi +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=5 + +# 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 #=================================================