From 85f251cc81d59a7bbae88f45156132d9996837c3 Mon Sep 17 00:00:00 2001 From: BlackcatRs Date: Thu, 25 Mar 2021 21:44:40 +0100 Subject: [PATCH] add public ip addr to client conf file --- wireguard-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 1cc8961..84b0acb 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -219,7 +219,7 @@ net.ipv6.conf.all.forwarding = 1" >/etc/sysctl.d/wg.conf } function newClient() { - ENDPOINT="${SERVER_PUB_IP}:${SERVER_PORT}" + ENDPOINT="$(grep -m 1 -oE '^[0-9]{1,3}(\.[0-9]{1,3}){3}$' <<< "$(wget -T 10 -t 1 -4qO- "http://ip1.dynupdate.no-ip.com/" || curl -m 10 -4Ls "http://ip1.dynupdate.no-ip.com/")"):${SERVER_PORT}" echo "" echo "Tell me a name for the client."