Skip to content

Commit

Permalink
Fix #40: Wrong status printout with Kill Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafficer authored and kaplun committed Nov 22, 2019
1 parent 25be553 commit 353b69b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions protonvpn_cli/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,22 +352,23 @@ def status():
current IP, server name, country, server load
"""
check_init()
pull_server_data()
logger.debug("Getting VPN Status")

# Quit if not connected
if not is_connected():
logger.debug("Disconnected")
ip, isp = get_ip_info()
print("Status: Disconnected")
print("IP: {0}".format(ip))
print("ISP: {0}".format(isp))

if os.path.isfile(os.path.join(CONFIG_DIR, "iptables.backup")):
print("[!] Kill Switch is active. Run protonvpn disconnect.")
print("[!] Kill Switch is currently active.")
logger.debug("Kill Switch active while VPN disconnected")
else:
ip, isp = get_ip_info()
print("IP: {0}".format(ip))
print("ISP: {0}".format(isp))
return

pull_server_data()

try:
connected_server = get_config_value("metadata", "connected_server")
connected_protocol = get_config_value("metadata", "connected_proto")
Expand Down

0 comments on commit 353b69b

Please sign in to comment.