3 SEARCH_PATTERN="ESP tunnel connected; exiting HTTPS mainloop."
5 # connects to SSH through openconnect and VPN
6 # for use with ProxyCommand in SSH
9 # first run openconnect
10 /sbin/start-stop-daemon --pidfile /tmp/nu-vpn-openconnect.pid -S --startas "$HOME/bin/nu-vpn-proxy/openconnect_command-ssh.sh" &
13 # kill connection on exit
15 /sbin/start-stop-daemon --stop --pidfile /tmp/nu-vpn-openconnect.pid
19 tail -f /tmp/nu-globalprotect-saml.log | grep -qe "${SEARCH_PATTERN}"
22 echo "Search terminated without finding the pattern"
26 # redirect traffic (standard input and output) through VPN
27 /bin/nc.openbsd -X 5 -x 127.0.0.1:9052 $1 $2