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
 
  10 # first run openconnect
 
  11 /sbin/start-stop-daemon --pidfile /tmp/nu-vpn-openconnect.pid -S --startas "${HOME}/bin/nu-vpn-proxy/openconnect_command-ssh.sh"
 
  14 # kill connection on exit
 
  16   /sbin/start-stop-daemon --stop --pidfile /tmp/nu-vpn-openconnect.pid
 
  20 tail -f /tmp/nu-globalprotect-saml.log | grep -qe "${SEARCH_PATTERN}"
 
  23     echo "Search terminated without finding the pattern"
 
  27 # redirect traffic (standard input and output) through VPN
 
  28 /bin/nc.openbsd -X 5 -x 127.0.0.1:9052 $1 $2