Skip to content

Instantly share code, notes, and snippets.

@antonengelhardt
Last active April 12, 2023 18:04
Show Gist options
  • Save antonengelhardt/c920a42a1fb8ce9e9f301b57da3b8c59 to your computer and use it in GitHub Desktop.
Save antonengelhardt/c920a42a1fb8ce9e9f301b57da3b8c59 to your computer and use it in GitHub Desktop.
Connect to WWU VPN using openconnect
#!bin/bash
# This script is used to connect to the WWU VPN. It is meant to be used with a
# keyboard shortcut. Change the Constants before running the script.
USER=<put-your-wwu-id-here>
PASSWORD=<put-your-wlan-netzzugangspasswort-here>
OTP_CODE=$(oathtool --totp <put-your-base-16-keimwert-here-get-it-from-wwu-it-portal>
VPN_HOST=vpn.uni-muenster.de
# use openconnect to connect to the VPN
if pgrep openconnect > /dev/null
then
echo "Disconnecting from VPN..."
sudo killall openconnect
else
echo "Connecting to VPN..."
{ echo ${USER}; echo ${PASSWORD}; echo ${OTP_CODE}; } | sudo openconnect -b -q ${VPN_HOST}
fi
@antonengelhardt
Copy link
Author

The script is now being maintained here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment