diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-03 05:23:17 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-03 06:06:59 +0100 |
commit | e498c7e268b8c69568f1e59c0c77964b861aa7c8 (patch) | |
tree | 833c620457877ec286b9a28ae698e68c9cf37d56 /contrib | |
parent | version: bump snapshot (diff) | |
download | wireguard-monolithic-historical-e498c7e268b8c69568f1e59c0c77964b861aa7c8.tar.xz wireguard-monolithic-historical-e498c7e268b8c69568f1e59c0c77964b861aa7c8.zip |
contrib: slight ncat tweak
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/examples/ncat-client-server/server.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/examples/ncat-client-server/server.sh b/contrib/examples/ncat-client-server/server.sh index 2680afd..bb45718 100755 --- a/contrib/examples/ncat-client-server/server.sh +++ b/contrib/examples/ncat-client-server/server.sh @@ -12,6 +12,6 @@ if [[ -z $NCAT_REMOTE_ADDR ]]; then exec ncat -e "$(readlink -f "$0")" -k -l -p 42912 -v fi read -r public_key -[[ $(wg show wg0 | grep peer | wc -l) -ge 253 ]] && wg set wg0 peer $(wg show wg0 latest-handshakes | sort -k 2 -b -n | head -n 1 | cut -f 1) remove +[[ $(wg show wg0 peers | wc -l) -ge 253 ]] && wg set wg0 peer $(wg show wg0 latest-handshakes | sort -k 2 -b -n | head -n 1 | cut -f 1) remove next_ip=$(all="$(wg show wg0 allowed-ips)"; for ((i=2; i<=254; i++)); do ip="192.168.4.$i"; [[ $all != *$ip/32* ]] && echo $ip && break; done) wg set wg0 peer "$public_key" allowed-ips $next_ip/32 2>/dev/null && echo "OK:$(wg show wg0 private-key | wg pubkey):$(wg show wg0 listen-port):$next_ip" || echo ERROR |