improve grep
This commit is contained in:
parent
e5ec486bd5
commit
0e30607e34
|
@ -30,7 +30,7 @@ if [ $clientCount -gt 0 ]; then
|
|||
do
|
||||
# remove peer from wireguard
|
||||
wg set wg0 peer ${clients[$i]} remove
|
||||
config=$(grep ${clients[$i]} /etc/wireguard/peers/*.conf|cut -d : -f 1)
|
||||
config=$(grep -l "PublicKey = ${clients[$i]}" /etc/wireguard/peers/*.conf)
|
||||
# add peer back to wireguard
|
||||
wg addconf wg0 $config
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue
Block a user