pivpn: [BUG] pivpn -r does not delete wireguard clients
In raising this issue, I confirm the following:
- I have read and understood the contributors guide.
- The issue I am reporting can be replicated.
- The issue I am reporting can be is directly related to the pivpn installer script.
- The issue I am reporting isn’t a duplicate (see FAQs, closed issues, and open issues).
Describe the bug when running command to remove clients for a wireguard install, it does nothing To Reproduce Steps to reproduce the behavior:
- run
sudo pivpn -r - it lists the current clients
- type the client name you want e.g. test2
- it exits after confirming
- run
pivpn list - confirm client is still listed, config file still in
/etc/wireguard/configs, keys still in/etc/wireguard/keysand peer still listed in/etc/wireguard/wg0.conf
Expected behavior
client config, client public and private keys deleted, client removed from peers in /etc/wireguard/wg0.conf and the client list in /etc/wireguard/configs/clients.txt
Server:
- VPN: Wireguard
- OS: Ubuntu 18.04.4 vm
- Version: latest as of 5-16-2020
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Less fragile way to add and remove clients (issue #1050) — committed to pivpn/pivpn by orazioedoardo 4 years ago
@toad77 I found the issue. The client still appeared in
client.txtbecause the grep command used to determine which line to remove returned multiple results when you had multiple clients with similar names liketodd,todd-2,3-todd, so the sed command that actually removed the line didn’t find the match.