From 135ac5033dfe48e8cc847910b3eff4295a4b4ac2 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 23:46:46 +0200 Subject: [PATCH] just a test to watch if it is possible like this install on root path --- scripts/change_url | 10 +++++++--- scripts/install | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 96e3e4a..682215d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,9 +68,13 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - 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 - + 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 = '/';" --target_file="$final_path/config.local.php" + fi +fi # Change the domain for nginx if [ $change_domain -eq 1 ] diff --git a/scripts/install b/scripts/install index 7327a06..5c34850 100644 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app