Merge pull request #73 from IRN-Kawakaze/Fix-Remove-an-existing-client
Fix the client removal regex.
This commit is contained in:
commit
0e06513eb5
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue