3 export OPENSSL_CONF="${HOME}/bin/nu-vpn-proxy/openssl.conf"
4 # this allows for legacy renegotation which seems to be required now
5 SEARCH_PATTERN="ESP tunnel connected; exiting HTTPS mainloop."
7 # connects to SSH through openconnect and VPN
8 # for use with ProxyCommand in SSH
11 # first run openconnect
12 /sbin/start-stop-daemon --pidfile /tmp/nu-vpn-openconnect.pid -S --startas "${HOME}/bin/nu-vpn-proxy/openconnect_command-ssh.sh" &
15 # kill connection on exit
17 /sbin/start-stop-daemon --stop --pidfile /tmp/nu-vpn-openconnect.pid
21 tail -f /tmp/nu-globalprotect-saml.log | grep -qe "${SEARCH_PATTERN}"
24 echo "Search terminated without finding the pattern"
28 # redirect traffic (standard input and output) through VPN
29 /bin/nc.openbsd -X 5 -x 127.0.0.1:9052 $1 $2