diff --git a/scripts/change_url b/scripts/change_url index 4775517..bcf134d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -90,9 +90,31 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# STOP SERVICE #================================================= +ynh_systemd_action --action=stop --service_name=$app + +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +# 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 +#================================================= + +ynh_systemd_action --action=start --service_name=$app + + #================================================= # GENERIC FINALISATION #=================================================