From d105480b9fadf9cdc6a1e63dc4cbe2c6de4dae8d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 24 Jun 2021 10:31:52 +0200 Subject: [PATCH] Fix --- manifest.json | 2 +- scripts/upgrade | 41 ++++++++++++++--------------------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/manifest.json b/manifest.json index d29ff31..b16ac07 100644 --- a/manifest.json +++ b/manifest.json @@ -57,7 +57,7 @@ "help": { "en": "The app can be accessed outside Yunohost and anyone will be able to create a trash email adress", "fr": "L'application sera accessible en dehors de yunohost et n'importe qui pourra y créer une adresse poubelle" - } + } } ] } diff --git a/scripts/upgrade b/scripts/upgrade index 9e2f6cc..fe286ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,6 +28,20 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -52,20 +66,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -83,19 +83,6 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -#UPDATE SETTINGS -#================================================= - -#mysqlpwd setting was implemented in ynh2 - check if saved and if not implement -db_pass=$(ynh_app_setting_get $app mysqlpwd) -if [ -z $db_pass ]; then -#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat /var/www/$app/conf.php | grep DBPASS) - db_pass=${t:26:24} - ynh_app_setting_set $app mysqlpwd $db_pass -fi - #================================================= #INSTALL SOURCES #===============================================