From 49c7cbcd290e9f961cf5e8df867059af8a030c2b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 30 May 2020 14:59:12 +0200 Subject: [PATCH] improving modify a config file step during upgrade --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 243e85b..e7de87b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,12 +147,15 @@ ynh_add_fpm_config #================================================= #================================================= -# STORE THE CONFIG FILE CHECKSUM +# MODIFY A CONFIG FILE #================================================= ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. ### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE" + +ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/CONFIG_FILE" + # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/CONFIG_FILE"