Bugfix default route handling by using $VPNPID (or GRANDparent process ID) to uniquely identify connection
In 01d3b8c0, I tried to fix an issue with default route restoration when multiple "stacked" VPNs were running. However, this actually caused more problems than it solved, by breaking default route restoration in the "usual" case of a single VPN.
The problem is that OpenConnect (and vpnc) always call the vpnc-script via
an intermediary, ephemeral shell process. So the GRANDparent process ID
must be used to persistently identify the VPN connection between vpnc-script
'connect' and 'disconnect' invocations. As of openconnect!278 (merged), OpenConnect will provide this in the VPNPID environment variable, so that we don't have to figure it out ourselves.
Fixes #28 (closed).
Edited by Daniel Lenski