From fbac88a28d262803a77061da24b2ad5226d7bdf7 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Wed, 6 Sep 2017 08:20:12 +0200 Subject: [PATCH] Put ynh_replace_string back (works with regexps) --- scripts/change_url | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 49964f7..deed315 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -60,9 +60,9 @@ then ynh_backup_if_checksum_is_different "$nginx_conf_path" # Replace locations starting with old_path # Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location) - sudo sed --in-place "s@location\( \(=\|~\|~\*\|\^~\)\)\? $old_path@location\1 $new_path@" "$nginx_conf_path" + ynh_replace_string "location\( \(=\|~\|~\*\|\^~\)\)\? $old_path" "location\1 $new_path" "$nginx_conf_path" # Replace path in "return" directives - sudo sed --in-place "s@return \([[:digit:]]\{3\}\) $old_path@return \1 $new_path@" "$nginx_conf_path" + ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path" ynh_store_file_checksum "$nginx_conf_path" fi