Created
August 10, 2023 16:10
-
-
Save retyui/94d3d3f0a0baa4533364d5b81dd83cb9 to your computer and use it in GitHub Desktop.
AnyConnect linux connect vpn script
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/expect | |
set USERNAME "<user>" | |
set PASSWORD [lindex $argv 0] | |
eval spawn /opt/cisco/anyconnect/bin/vpn connect vpn.mysite.com | |
expect "Connect Anyway" { send "y\r" } | |
expect "import the certificate" { send "n\r" } | |
expect "Username:" { send "$USERNAME\r" } | |
expect "Password:" { send "$PASSWORD\r" } | |
set timeout 60 | |
expect "VPN>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment