From 35cb8597cbf97a66525f6944948de9926a990237 Mon Sep 17 00:00:00 2001 From: Yalh Date: Fri, 25 Jan 2019 22:16:20 +0100 Subject: [PATCH] Add change_url --- check_process | 4 ++-- scripts/change_url | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index cc7c062..f027f11 100644 --- a/check_process +++ b/check_process @@ -29,8 +29,8 @@ backup_restore=1 multi_instance=1 incorrect_path=1 - port_already_use=0 - change_url=0 + port_already_use=1 + change_url=1 ;;; Levels Level 1=auto Level 2=auto diff --git a/scripts/change_url b/scripts/change_url index f71fc77..24b37da 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -93,6 +93,20 @@ fi # ... #================================================= +# Stop writefreely for modification +yunohost service stop "$app" + +ynh_replace_string "host =.*" "host =https://$new_domain$new_path" "$final_path/config.ini" + +# Start writefreely after modification +yunohost service start $app + +### 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/config.ini" +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum "$final_path/config.ini" + #================================================= # GENERIC FINALISATION #=================================================