Created
January 29, 2020 13:29
-
-
Save jfeilbach/546cb88dd1d4f67c70889ade385acf53 to your computer and use it in GitHub Desktop.
bash script to start cisco anyconnect vpn client via cli and use 2fa
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
#!/bin/bash | |
STTY=$(stty -g) | |
stty -echo | |
echo -e "connect <vpn server>/<path>\n<vpn user>" | |
/usr/bin/security find-generic-password -wl vpnpass.extadmin | |
oathtool --totp -b "$(/usr/bin/security find-generic-password -wl oathkey.extadmin)" | |
echo -e "y\n" | |
#stty "${STTY}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment