From ba39b64ee1d9dc4496a91ce17c67799a3cdf1f34 Mon Sep 17 00:00:00 2001 From: Gavin <96492140+G-only1@users.noreply.github.com> Date: Mon, 13 Apr 2026 16:43:57 -0400 Subject: [PATCH] Fix add-client.sh Fix issue that made add-client.sh stop at line 42 --- scripts/add-client.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add-client.sh b/scripts/add-client.sh index 2d8a801..393ade4 100755 --- a/scripts/add-client.sh +++ b/scripts/add-client.sh @@ -40,7 +40,7 @@ echo -e "${X}" # a peer doesn't cause the next add to collide with an existing one. HIGHEST=$(grep -oE "${WG_SUBNET//./\\.}\.[0-9]+/32" /etc/wireguard/wg1.conf 2>/dev/null \ - | awk -F'[./]' '{print $4}' | sort -n | tail -1) + | awk -F'[./]' '{print $4}' | sort -n | tail -1 || true) HIGHEST=${HIGHEST:-1} # .1 is the server itself CLIENT_NUM=$((HIGHEST + 1)) if [ "$CLIENT_NUM" -lt 2 ]; then CLIENT_NUM=2; fi