From 13ad7382f9810df611a17dee1a82f142fe21fd6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:40:14 +0200 Subject: [PATCH] cleaning --- scripts/restore | 15 +++++++-------- scripts/upgrade | 22 ++++++---------------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/scripts/restore b/scripts/restore index 94d8d53..b361306 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,14 +8,6 @@ source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -25,6 +17,13 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d2f0dc6..84b3807 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,12 +8,6 @@ source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -28,18 +22,14 @@ fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=4 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=4 +# Remove the app directory securely +ynh_secure_remove --file="$install_dir" - # Remove the app directory securely - ynh_secure_remove --file="$install_dir" - - # Download, the source from sources folder - mkdir -p $install_dir && cp -a ../sources/* $install_dir - ynh_add_config --template="../sources/index.html" --destination="$install_dir/index.html" -fi +# Download, the source from sources folder +mkdir -p $install_dir && cp -a ../sources/* $install_dir +ynh_add_config --template="../sources/index.html" --destination="$install_dir/index.html" chown -R $app:www-data "$install_dir"