ZSH functions to start/stop OpenConnect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ZSH functions to start/stop OpenConnect VPN client | |
# | |
# In my setup the VPN username is the same as $USER | |
# | |
export VPN_HOST=<your VPN host> | |
function vpn-up() { | |
if [[ -z $VPN_HOST ]] | |
then | |
echo "Please set VPN_HOST env var" | |
return | |
fi | |
echo "Starting the vpn ..." | |
sudo openconnect --background --user=$USER $VPN_HOST | |
} | |
function vpn-down() { | |
sudo kill -2 `pgrep openconnect` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment