Fix backup core only

This commit is contained in:
Josué Tille 2020-12-07 17:04:52 +01:00
parent a9d9989b49
commit adcb5ba66c
No known key found for this signature in database
GPG Key ID: 716A6C99B04194EF
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,12 @@ ynh_user_exists "$admin" \
# Check Final Path availability # Check Final Path availability
test ! -e "$final_path" || ynh_die --message "This path already contains a folder" 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 # Generate random password and key
ynh_script_progression --message="Defining db password and key..." ynh_script_progression --message="Defining db password and key..."
dbpass=$(ynh_string_random) dbpass=$(ynh_string_random)

View File

@ -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_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 ynh_script_progression --message="Removal of $app completed" --last
sleep 1