From 05064513640e2486999303a4bea8c4b72440068b Mon Sep 17 00:00:00 2001 From: nam1n15 <nam1n15@ecs.soton.ac.uk> Date: Thu, 30 Nov 2023 16:48:37 +0000 Subject: [PATCH] a shell with university vpn, for e.g. inspecting DNS / UDP things yeah it breaks all the other connections; not ideal --- uni-vpn-shell.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 uni-vpn-shell.sh diff --git a/uni-vpn-shell.sh b/uni-vpn-shell.sh new file mode 100644 index 0000000..da6df60 --- /dev/null +++ b/uni-vpn-shell.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -eu + +# caveats: breaks existing vpn connection + +echo First enter credentials for globalprotect.soton.ac.uk +read -p 'Username: ' username +read -s -p 'Password: ' password + +vpn_connection() { + csd_wrapper="--csd-wrapper /usr/libexec/openconnect/hipreport.sh" # fedora + user="--user $username" + pass="--passwd-on-stdin" + echo $password | openconnect --script-tun --script "vpnns --attach" --protocol=gp $csd_wrapper globalprotect.soton.ac.uk $user $pass + +} + +vpn_connection & +vpnns -- bash + +echo Connection OK? -- GitLab