From b7be000d99ebe3abd654e9f643b4f965aed40fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:36:48 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b3ea522..cb2c788 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,22 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - ynh_setup_source --dest_dir="$install_dir" --keep="config/baikal.yaml" -fi +ynh_setup_source --dest_dir="$install_dir" --keep="config/baikal.yaml" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -49,19 +39,15 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg #================================================= # UPGRADE BAIKAL CONFIGURATION #================================================= +ynh_script_progression --message="Upgrading the configuration file..." --weight=2 # We keep this to allow upgrade the config file in case it needs to be changed. -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading the configuration file..." --weight=2 - - timezone=$(cat /etc/timezone) - path=${path%/} - ynh_add_config --template="baikal.yaml" --destination="$install_dir/config/baikal.yaml" - chown $app: "$install_dir/config/baikal.yaml" - chmod 640 "$install_dir/config/baikal.yaml" -fi +timezone=$(cat /etc/timezone) +path=${path%/} +ynh_add_config --template="baikal.yaml" --destination="$install_dir/config/baikal.yaml" +chown $app: "$install_dir/config/baikal.yaml" +chmod 640 "$install_dir/config/baikal.yaml" #================================================= # END OF SCRIPT