From 4bf62bcbe723aa3c69e6cbccd38d0b8e213e4d7b Mon Sep 17 00:00:00 2001 From: Grische <2787581+grische@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:38:58 +0100 Subject: [PATCH] fix combine_ip_port --- .../lib/gluon/gluon-mesh-wireguard-vxlan/checkuplink | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ffmuc-mesh-vpn-wireguard-vxlan/files/lib/gluon/gluon-mesh-wireguard-vxlan/checkuplink b/ffmuc-mesh-vpn-wireguard-vxlan/files/lib/gluon/gluon-mesh-wireguard-vxlan/checkuplink index af2c6c78..f0717fbd 100755 --- a/ffmuc-mesh-vpn-wireguard-vxlan/files/lib/gluon/gluon-mesh-wireguard-vxlan/checkuplink +++ b/ffmuc-mesh-vpn-wireguard-vxlan/files/lib/gluon/gluon-mesh-wireguard-vxlan/checkuplink @@ -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" }