From a7541b6d0d5ebad604b811ceda4801a91b8dd44d Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Thu, 9 Apr 2020 16:23:39 +0200 Subject: [PATCH] try to debug slash for root directory in change_url --- scripts/change_url | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index ba0024e..00e04b0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -75,12 +75,6 @@ then path_url="$new_path" # Create a dedicated nginx config ynh_add_nginx_config -elif [ "$new_path" == "/" ] -then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php" -else - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" -fi # Change the domain for nginx if [ $change_domain -eq 1 ] @@ -101,6 +95,15 @@ ynh_script_progression --message="Reloading nginx web server..." --time --weight ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# last configuration +#================================================= +if [ $change_path -eq 1 && "$new_path" == "/"] +then + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php" +else + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" +fi #================================================= # END OF SCRIPT #=================================================