From 388b15a8d243201a41de0e3a973e8fd3d0959596 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 8 Feb 2019 23:29:28 +0100 Subject: [PATCH] update URL in the .env file --- scripts/change_url | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 1018e97..bcf134d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -99,8 +99,14 @@ ynh_systemd_action --action=stop --service_name=$app # MODIFY A CONFIG FILE #================================================= -# 9999 TODO : Change the config file or the systemd file -#ynh_replace_string "EXTERNAL_URL=.*" "EXTERNAL_URL=https://$new_domain$new_path" "$final_path/.env" +# Change the URL in the configuration file +ynh_replace_string "EXTERNAL_URL=.*" "EXTERNAL_URL=https://$new_domain$new_path" "$final_path/.env" + +### 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 "$final_path/.env" +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum "$final_path/.env" #================================================= # START SERVICE