[[$(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
next_ip=$(all="$(wg show wg0 allowed-ips)";for((i=2; i<=254; i++));doip="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