From e1002897564bf14d95d1a335992c63e165d462ea Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 12 Feb 2024 10:08:28 -0800 Subject: [PATCH] Should work now (ive jinxed it havent i) --- scripts/change_url | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c00e68f..2c593f7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,11 +21,19 @@ ynh_change_url_nginx_config # ynh_script_progression --message="Updating app configuration..." --weight=1 -# Try a sed command? nowhere near finished I'll finish it soon enough +# this might be a roundabout way of doing it? if [ "$new_path" == "/" ] && [ "$old_path" == "/" ]; then - sed 's/${old_domain//\//\\\/}/${new_domain//\//\\\/}/g' + sed -i 's|$old_domain|$new_domain' $install_dir/config.php +elif [ "$new_path" == "/" ] && [ "$old_path" != "/" ]; then + sed -i 's|$old_domain$old_path|$new_domain' +elif [ "$new_path" != "/" ] && [ "$old_path" == "/" ]; then + sed -i 's|$old_domain|$new_domain$new_path' +elif [ "$new_path" != "/" ] && [ "$old_path" != "/" ]; then + sed -i 's|$old_domain$old_path|$new_domain$new_path' $install_dir/config.php else - sed 's/${old_domain//\//\\\/}/ + ynh_print_warn --message="Didn't match a result for old/new paths. Attempting subdomain config." + sed -i 's|$old_domain|$new_domain' $install_dir/config.php +fi #================================================= # END OF SCRIPT