I configure my SSH with ControlMaster connections that must be closed when I disconnect from VPN, otherwise they are left stale and existing and future SSH session are left hanging/wedged.
To accomodate this, the last patch in this series teaches openconnect-sso automatically run a configured command on VPN disconnection. In my case, I run a shell script that does ssh -O exit ... on my connections, although this doesn't matter from openconnect-sso's POV.
Otherwise the other patches are only tangentially related:
Patch#1 fixes an obvious bug in the develop branch.
Patch#2 stops openconnect-sso from crashing when the config file cannot be written. It allows me to control the openconnect-sso configuration via home-manager (which stores a symlink to a read-only file in the Nix store).
Patch#3 moves code from the async _run() into the sync run(). Specifically it moves the running of the openconnect subprocess which does not benefit from being async. This also fixes the control flow when aborting openconnect with Ctrl+C.
I configure my SSH with ControlMaster connections that must be closed when I disconnect from VPN, otherwise they are left stale and existing and future SSH session are left hanging/wedged.
To accomodate this, the last patch in this series teaches openconnect-sso automatically run a configured command on VPN disconnection. In my case, I run a shell script that does
ssh -O exit ...
on my connections, although this doesn't matter from openconnect-sso's POV.Otherwise the other patches are only tangentially related:
develop
branch._run()
into the syncrun()
. Specifically it moves the running of theopenconnect
subprocess which does not benefit from being async. This also fixes the control flow when abortingopenconnect
withCtrl+C
.This supersedes https://github.com/vlaci/openconnect-sso/pull/32, but is based on
develop
instead ofmaster
, as I found it easier to get this done on top of those changes.