From ac3153d399ad8bfe4882f64c2026147a21b6437f Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Thu, 9 Apr 2020 16:34:30 +0200 Subject: [PATCH] try to debug slash for root directory in change_url --- scripts/change_url | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 00e04b0..4a039ee 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -73,8 +73,15 @@ then # Set global variables for nginx helper domain="$old_domain" path_url="$new_path" +if [ "$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 # Create a dedicated nginx config ynh_add_nginx_config +fi # Change the domain for nginx if [ $change_domain -eq 1 ] @@ -98,12 +105,6 @@ 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 #=================================================