From 94e337f5c2293a2c96762f0d071c42357b4482bc Mon Sep 17 00:00:00 2001 From: Nathan TeBlunthuis Date: Wed, 11 May 2022 20:03:51 -0700 Subject: [PATCH] Commands to connect / disconnect from NU vpn. --- openconnect_command-http.sh | 17 +++++++++++++++++ start-http-vpn-proxy | 5 +++++ stop-http-vpn-proxy | 3 +++ 3 files changed, 25 insertions(+) create mode 100755 openconnect_command-http.sh create mode 100755 start-http-vpn-proxy create mode 100755 stop-http-vpn-proxy diff --git a/openconnect_command-http.sh b/openconnect_command-http.sh new file mode 100755 index 0000000..0c519c6 --- /dev/null +++ b/openconnect_command-http.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +LOG_FILE=/tmp/nu-globalprotect-saml.log +PID_FILE=/tmp/nu-vpn-openconnect_http.pid + +exec > $LOG_FILE + +# change to the vpn file directory +cd ~/bin/nu-vpn-proxy + +## do the authentication +eval $( ./gp-saml-gui.py -v --clientos=Linux vpn-connect2.northwestern.edu ) + + +echo "$COOKIE" | /usr/sbin/openconnect --verbose --useragent="PAN GlobalConnect" --version-string='5.1.0-101' --protocol=gp -u "$USER" --os="$OS" --passwd-on-stdin "$HOST" --csd-wrapper="hipreport-modified.sh" --reconnect-timeout 60 --script-tun --script "ocproxy -D 8181 --keepalive 5 --verbose" -b --pid-file "${PID_FILE}" + + diff --git a/start-http-vpn-proxy b/start-http-vpn-proxy new file mode 100755 index 0000000..f947b8e --- /dev/null +++ b/start-http-vpn-proxy @@ -0,0 +1,5 @@ +#!/bin/bash + +/sbin/start-stop-daemon --pidfile /tmp/nu-vpn-openconnect_http.pid -S --startas "$HOME/bin/nu-vpn-proxy/openconnect_command-http.sh" + + diff --git a/stop-http-vpn-proxy b/stop-http-vpn-proxy new file mode 100755 index 0000000..ede7b25 --- /dev/null +++ b/stop-http-vpn-proxy @@ -0,0 +1,3 @@ +#!/bin/bash + +/sbin/start-stop-daemon --stop --pidfile /tmp/nu-vpn-openconnect_http.pid -- 2.39.5