HenrikBengtsson / ucsf-vpn

Linux command-line client to manage a UCSF VPN connection
https://github.com/HenrikBengtsson/ucsf-vpn
32 stars 4 forks source link

ucsf vpn stop: try a bit more when failing #46

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

Issue

If I forget to disconnect from the VPN and sleep my notebook, then I have a broken internet connection when I open it up again. Then I do:

$ ucsf vpn stop
WARNING: This action ('ucsf vpn stop') requires administrative ("sudo") rights.
Enter the password for your account ('alice') on your local computer ('laptop'): 
ERROR: Failed to terminate VPN process ('openconnect' with PID 29161). You could manually kill
*all* OpenConnect processes by calling 'sudo pkill -INT openconnect'. CAREFUL! [ucsf-vpn 5.3.0-9001,
OpenConnect 7.08-3ubuntu0.18.04.2]
$ 

However, if I call it again, it always managed to reset the connection;

$ ucsf vpn stop
OK: OpenConnect status: No 'openconnect' process running
OK: Public IP information: ip=192.124.70.215, hostname=192-124-70-215.ips-provider.org, org=AS46313
ISP Provider
OK: Not connected to the VPN
$ 

Suggestion

Figure out why the first ucsf vpn stop fails but then the second works. Understanding that should make it possible to make the first ucsf vpn stop call to succeed.