Last active
October 19, 2023 12:17
-
-
Save cyxou/880780195ca93fd8cf0fa487ed53e28f to your computer and use it in GitHub Desktop.
Openconnect and OpenVPN connections scripts
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
#!/usr/bin/env bash | |
set -e | |
echo "Starting connection..." | |
USERNAME=<USERNAME> | |
PASSWORD=<PASSWORD> | |
VPN_HOST=<VPN_HOST> | |
TOTP_SECRET="sha1:base32:<SECRET>" | |
openconnect --background --token-mode=totp --token-secret=$TOTP_SECRET --user=$USERNAME $VPN_HOST | |
printf "%s\n" $PASSWORD | openconnect --background --token-mode=totp --token-secret=$TOTP_SECRET --user=$USERNAME --passwd-on-stdin $VPN_HOST |
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
#!/usr/bin/env bash | |
set -e | |
echo "Starting connection..." | |
openvpn3 session-start --config /home/ubuntu/<YOUR_OPENVPN_PROFILE>.ovpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment