]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
Add attempt-reconnect invocation
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 16 Jan 2019 08:33:50 +0000 (10:33 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 16 Jan 2019 08:33:50 +0000 (10:33 +0200)
See https://gitlab.com/openconnect/openconnect/issues/17

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
vpnc-script

index 6a5554647ec7b65332180f41da7df05780289936..7b7823f9e7432cbffaf41ee480793e0240f4cee8 100755 (executable)
@@ -21,7 +21,7 @@
 ################
 #
 # List of parameters passed through environment
-#* reason                       -- why this script was called, one of: pre-init connect disconnect reconnect
+#* reason                       -- why this script was called, one of: pre-init connect disconnect reconnect attempt-reconnect
 #* VPNGATEWAY                   -- vpn gateway address (always present)
 #* TUNDEV                       -- tunnel device (always present)
 #* INTERNAL_IP4_ADDRESS         -- address (always present)
@@ -1018,7 +1018,15 @@ case "$reason" in
                do_disconnect
                run_hooks post-disconnect
                ;;
+       attempt-reconnect)
+               # Invoked before each attempt to re-establish the session.
+               # If the underlying physical connection changed, we might
+               # be left with a route to the VPN server through the VPN
+               # itself, which would need to be fixed.
+               run_hooks attempt-reconnect
+               ;;
        reconnect)
+               # After successfully re-establishing the session.
                run_hooks reconnect
                ;;
        *)