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:

  1. run sudo pivpn -r
  2. it lists the current clients
  3. type the client name you want e.g. test2
  4. it exits after confirming
  5. run pivpn list
  6. confirm client is still listed, config file still in /etc/wireguard/configs, keys still in /etc/wireguard/keys and 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

Most upvoted comments

@toad77 I found the issue. The client still appeared in client.txt because the grep command used to determine which line to remove returned multiple results when you had multiple clients with similar names like todd, todd-2, 3-todd, so the sed command that actually removed the line didn’t find the match.