Skip to content

Commit

Permalink
fix combine_ip_port
Browse files Browse the repository at this point in the history
  • Loading branch information
grische committed Mar 16, 2024
1 parent 90f6cb7 commit 4bf62bc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ combine_ip_port() {
local ip="$1"
local port="$2"

if [[ ${ip} == *":"* ]]; then
# Add brackets in case the IP is an IPv6
case $ip in
*":"*)
ip="[${ip}]"
fi
;;
esac

echo "$ip:$port"
}

Expand Down

0 comments on commit 4bf62bc

Please sign in to comment.