mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-28 18:50:08 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e27df50ee3
commit
15bad014b4
@ -1,19 +1,19 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
CLIENT_IPS=${CLIENT_IPS}
|
CLIENT_IPS=${CLIENT_IPS}
|
||||||
|
|
||||||
BASE_IP=${CLIENT_IPS/0\/*}
|
BASE_IP=${CLIENT_IPS/0\/*}
|
||||||
IPs=($(cat /etc/wireguard/clients/* \
|
IPs=($(cat /etc/wireguard/clients/* \
|
||||||
| grep Address \
|
| grep Address \
|
||||||
| cut -d'.' -f 4 \
|
| cut -d'.' -f 4 \
|
||||||
| cut -d '/' -f 1 \
|
| cut -d '/' -f 1 \
|
||||||
| sort))
|
| sort))
|
||||||
IPs=${IPs[@]}
|
IPs=${IPs[@]}
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
while [ "$( echo $IPs | fgrep -w $i )" ] ; do
|
while [ "$( echo $IPs | fgrep -w $i )" ] ; do
|
||||||
i=$(( i + 1 ))
|
i=$(( i + 1 ))
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $BASE_IP.$i
|
echo $BASE_IP.$i
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user