mirror of
https://github.com/angristan/wireguard-install.git
synced 2024-10-31 18:52:31 +00:00
Handle IPv6 format for server endpoint
Fix https://github.com/angristan/wireguard-install/issues/352
This commit is contained in:
parent
d7b8cd9948
commit
c97e3cc6b3
@ -273,6 +273,12 @@ net.ipv6.conf.all.forwarding = 1" >/etc/sysctl.d/wg.conf
|
||||
}
|
||||
|
||||
function newClient() {
|
||||
# If SERVER_PUB_IP is IPv6, add brackets if missing
|
||||
if [[ ${SERVER_PUB_IP} =~ .*:.* ]]; then
|
||||
if [[ ${SERVER_PUB_IP} != *"["* ]] || [[ ${SERVER_PUB_IP} != *"]"* ]]; then
|
||||
SERVER_PUB_IP="[${SERVER_PUB_IP}]"
|
||||
fi
|
||||
fi
|
||||
ENDPOINT="${SERVER_PUB_IP}:${SERVER_PORT}"
|
||||
|
||||
echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user