Correct regex for port parsing
This commit is contained in:
parent
a85c334e4d
commit
ed7ba14cb1
|
@ -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 -r 's/^[^:]+|[^[:digit:]]//g')"
|
local port="$(echo $hostport | grep : | sed -r 's_^.*:+|/.*$__g')"
|
||||||
|
|
||||||
local host
|
local host
|
||||||
if [ -n "$port" ]; then
|
if [ -n "$port" ]; then
|
||||||
|
|
Loading…
Reference in a new issue