improve grep

This commit is contained in:
Matthew Saunders Brown 2022-07-15 09:37:27 -07:00
parent e5ec486bd5
commit 0e30607e34

View File

@ -30,7 +30,7 @@ if [ $clientCount -gt 0 ]; then
do do
# remove peer from wireguard # remove peer from wireguard
wg set wg0 peer ${clients[$i]} remove 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 # add peer back to wireguard
wg addconf wg0 $config wg addconf wg0 $config
done done