diff --git a/check_process b/check_process index 0cb5a4a..895ff42 100755 --- a/check_process +++ b/check_process @@ -21,8 +21,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..eb7dada 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -93,6 +93,21 @@ fi # ... #================================================= +# Stop writefreely for modification +yunohost service stop $app + +ynh_replace_string "$old_domain" "$new_domain" "$final_path/$app/.env" + +# 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/$app/.env" +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum "$final_path/$app/.env" +ynh_store_file_checksum "$final_path/$app/.env" + #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6a09d93..10f049d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,8 +68,6 @@ ynh_abort_if_errors # Stop Plume for upgrade yunohost service stop "$app" - - #================================================= # CHECK THE PATH #=================================================