Created
June 2, 2014 12:03
-
-
Save dims/59be0c075f29e7ec26a8 to your computer and use it in GitHub Desktop.
Expect script for logging into VPN using Anyconnect client (works on osx and linux)
This file contains hidden or 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 timeout 20 | |
spawn "/opt/cisco/anyconnect/bin/vpn" | |
expect "VPN>" { send "connect server.ip.address.or.hostname\r" } | |
expect "*sername*" { send "MY_USERID\r" } | |
expect "*assword*" { send "MY_PASSWORD\r" } | |
expect "state: Connected" { send "exit\r" } | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment