Fix port parsing from amqp_uri

This commit is contained in:
evgeniy-antonyuk 2022-10-28 11:59:08 +03:00
parent a3973583f8
commit a85c334e4d

View file

@ -199,7 +199,7 @@ parse_rabbitmq_url(){
# extract the host # extract the host
local hostport="$(echo ${url/$userpass@/} | cut -d/ -f1)" local hostport="$(echo ${url/$userpass@/} | cut -d/ -f1)"
# by request - try to extract the port # by request - try to extract the port
local port="$(echo $hostport | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')" local port="$(echo $hostport | sed -r 's/^[^:]+|[^[:digit:]]//g')"
local host local host
if [ -n "$port" ]; then if [ -n "$port" ]; then