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