diff --git a/lib/lib.sh b/lib/lib.sh index efc8b42c..789bec0a 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -323,6 +323,16 @@ function get_host_port() { if test -z "$config"; then echo "$IP:3000" else + # Try to extract custom port from explicitly set ROOT_URL + local root_url="$(sed -ne 's/^ROOT_URL *= *\(.*\)/\1/p' < "$config")" + local port="${root_url##*:}" + + if [[ ! -z "$port" ]]; then + echo "$IP:$port" + exit + fi + + # Fall back to the set port echo "$IP:$(sed -n -e 's/^HTTP_PORT *= *\(.*\)/\1/p' <$config)" fi }