Skip to content

Commit

Permalink
Fix false positives of openvpn process detection
Browse files Browse the repository at this point in the history
On systems using NetworkManager, there's [nm-openvpn-auth] process
running. The present test for openvpn matches such a process and
fails to connect. Adding --exact fixes the problem as it matches
only "openvpn" processes (exactly).
  • Loading branch information
mrtnmch committed Jan 3, 2020
1 parent 80a4c6d commit 61f04db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protonvpn_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get_default_nic():

def is_connected():
"""Check if a VPN connection already exists."""
ovpn_processes = subprocess.run(["pgrep", "openvpn"],
ovpn_processes = subprocess.run(["pgrep", "--exact", "openvpn"],
stdout=subprocess.PIPE)
ovpn_processes = ovpn_processes.stdout.decode("utf-8").split()

Expand Down

0 comments on commit 61f04db

Please sign in to comment.