From adcb5ba66c2f1bf958006dab9afbdce43a507556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 7 Dec 2020 17:04:52 +0100 Subject: [PATCH] Fix backup core only --- scripts/install | 6 ++++++ scripts/remove | 1 + 2 files changed, 7 insertions(+) diff --git a/scripts/install b/scripts/install index 542c639..c6a0741 100644 --- a/scripts/install +++ b/scripts/install @@ -33,6 +33,12 @@ ynh_user_exists "$admin" \ # Check Final Path availability test ! -e "$final_path" || ynh_die --message "This path already contains a folder" +if [ -e "$DATADIR" ]; then + old_data_dir_path="$DATADIR$(date '+%Y%m%d.%H%M%S')" + ynh_print_warn "A data directory already exist. Data was renamed to $old_data_dir_path" + mv "$DATADIR" "$old_data_dir_path" +fi + # Generate random password and key ynh_script_progression --message="Defining db password and key..." dbpass=$(ynh_string_random) diff --git a/scripts/remove b/scripts/remove index 3d2f9fb..36ce240 100644 --- a/scripts/remove +++ b/scripts/remove @@ -61,3 +61,4 @@ ynh_remove_fail2ban_config ynh_print_info --message="Due of the backup core only feature the data directory in '$DATADIR' was not removed. It need to be removed manually to purge app user data." ynh_script_progression --message="Removal of $app completed" --last +sleep 1