From 984281b63e4c036be0be9ad91763e0e89aff8c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 26 May 2024 15:24:04 +0200 Subject: [PATCH] upgrade: try to clean up --- scripts/upgrade | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 00ddfbb..d32876d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,20 @@ fi #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +if [ -f "/usr/local/bin/backup-with-${app}" ]; then + ynh_secure_remove --file="/usr/local/bin/backup-with-${app}" +fi + +if [ -d "/opt/yunohost/$app" ]; then + mv "/opt/yunohost/$app/"* "/opt/yunohost/$app/".* "$install_dir" + ynh_secure_remove --file="/opt/yunohost/$app/check-restic" + ynh_secure_remove --file="/opt/yunohost/$app/check_method_restic" + ynh_secure_remove --file="/opt/yunohost/$app/restic_check_log_restic" + ynh_secure_remove --file="/opt/yunohost/$app/restic_log_restic" + ynh_secure_remove --file="/opt/yunohost/$app/" +fi # old versions did not have delimiters in ~/.ssh/config making removal in # multi-instance cases break the remaining instances.