From e29d28646890316f910d003cdaeace77748d6b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Feb 2024 23:05:18 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 47 ++++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b40049b..5559353 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,44 +16,29 @@ then ynh_app_setting_set --app=$app --key=password --value="$password" fi -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 -# Get rid of legacy symlinks -[ -L "$install_dir/_data" ] && ynh_secure_remove "$install_dir/_data" || true -[ -L "$install_dir/galleries" ] && ynh_secure_remove "$install_dir/galleries" || true -[ -L "$install_dir/upload" ] && ynh_secure_remove "$install_dir/upload" || true +ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin +ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin -if [ "$upgrade_type" == "UPGRADE_APP" ] +# We don't want to keep those in the install dir, they already are in $data_dir +if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ] then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - ynh_setup_source --dest_dir="$install_dir" - ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin - ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin - - # We don't want to keep those in the install dir, they already are in $data_dir - if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ] - then - ynh_secure_remove "$install_dir/_data" - fi - if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ] - then - ynh_secure_remove "$install_dir/galleries" - fi - if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ] - then - ynh_secure_remove "$install_dir/upload" - fi - + ynh_secure_remove "$install_dir/_data" fi +if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ] +then + ynh_secure_remove "$install_dir/galleries" +fi +if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ] +then + ynh_secure_remove "$install_dir/upload" +fi + chmod 750 "$data_dir" chmod -R o-rwx "$data_dir"