From 7d524c2c2757ae947c0ce277a7545d1a92740ad1 Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 12 Feb 2024 10:28:01 -0800 Subject: [PATCH] Update change_url tested 1 and it works, working on the rest. --- scripts/change_url | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 246227b..c6d1d15 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -25,14 +25,15 @@ 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%?}|$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${new_path%?}|' $install_dir/config.php elif [ "$new_path" != "/" ] && [ "$old_path" != "/" ]; then - sed -i 's|$old_domain$old_path|$new_domain$new_path|' $install_dir/config.php + # Works + sed -i 's|$old_domain${old_path%?}|$new_domain${new_path%?}|' $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 + sed -i 's|$old_domain|$new_domain|' $install_dir/config.php fi #=================================================