From ca2178cff23be78c354f178dbce22dd4a8f05392 Mon Sep 17 00:00:00 2001 From: randomshell Date: Thu, 2 Jul 2020 15:08:10 +0000 Subject: [PATCH] Clean $ENDPOINT code https://github.com/angristan/wireguard-install/pull/58#discussion_r449002047 --- wireguard-install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 7ec9dd5..f1ed23e 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -203,11 +203,7 @@ function newClient() { # shellcheck disable=SC1091 source /etc/wireguard/params - if [[ $SERVER_PUB_IP =~ .*:.* ]]; then - ENDPOINT="[$SERVER_PUB_IP]:$SERVER_PORT" - else - ENDPOINT="$SERVER_PUB_IP:$SERVER_PORT" - fi + ENDPOINT="${SERVER_PUB_IP}:${SERVER_PORT}" printf "\n" until [[ "$CLIENT_WG_IPV4" =~ ^([0-9]{1,3}\.?){4}$ ]]; do