mirror of
https://github.com/hwdsl2/wireguard-install.git
synced 2024-09-22 00:00:55 +02:00
Fix: Remove an existing client.
"Remove an existing client" may mistakenly remove multiple clients. For example: remove client "test" will also remove client "test1".
This commit is contained in:
parent
f2f0d3d3ac
commit
2a6df4daf0
|
@ -580,7 +580,7 @@ else
|
||||||
# Remove from the live interface
|
# Remove from the live interface
|
||||||
wg set wg0 peer "$(sed -n "/^# BEGIN_PEER $client$/,\$p" /etc/wireguard/wg0.conf | grep -m 1 PublicKey | cut -d " " -f 3)" remove
|
wg set wg0 peer "$(sed -n "/^# BEGIN_PEER $client$/,\$p" /etc/wireguard/wg0.conf | grep -m 1 PublicKey | cut -d " " -f 3)" remove
|
||||||
# Remove from the configuration file
|
# Remove from the configuration file
|
||||||
sed -i "/^# BEGIN_PEER $client/,/^# END_PEER $client/d" /etc/wireguard/wg0.conf
|
sed -i "/^# BEGIN_PEER $client$/,/^# END_PEER $client$/d" /etc/wireguard/wg0.conf
|
||||||
echo
|
echo
|
||||||
echo "$client removed!"
|
echo "$client removed!"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user