From bb83443137fe7fa6d8c762b764ef31c126baba5b Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 12 Feb 2024 12:32:23 -0800 Subject: [PATCH] likely not gonna work but we're gonna try --- scripts/change_url | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c6d1d15..1538f77 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -25,12 +25,12 @@ ynh_script_progression --message="Updating app configuration..." --weight=1 if [ "$new_path" == "/" ] && [ "$old_path" == "/" ]; then 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|' $install_dir/config.php + sed -i 's|$old_domain${old_path:0:-1}|$new_domain|' $install_dir/config.php elif [ "$new_path" != "/" ] && [ "$old_path" == "/" ]; then - sed -i 's|$old_domain|$new_domain${new_path%?}|' $install_dir/config.php + sed -i 's|$old_domain|$new_domain${old_path:0:-1}|' $install_dir/config.php elif [ "$new_path" != "/" ] && [ "$old_path" != "/" ]; then # Works - sed -i 's|$old_domain${old_path%?}|$new_domain${new_path%?}|' $install_dir/config.php + sed -i 's|$old_domain${old_path:0:-1}|$new_domain${old_path:0:-1}|' $install_dir/config.php else 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