Created
September 17, 2010 03:37
-
-
Save joet3ch/583627 to your computer and use it in GitHub Desktop.
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 -f | |
set force_conservative 1 ;# set to 1 to force conservative mode even if | |
;# script wasn't run conservatively originally | |
if {$force_conservative} { | |
set send_slow {1 .1} | |
proc send {ignore arg} { | |
sleep .1 | |
exp_send -s -- $arg | |
} | |
} | |
set timeout -1 | |
spawn $env(SHELL) | |
match_max 100000 | |
expect -re "# |$ " | |
send -- "telnet 10.0.0.1\r" | |
expect -re "password: |Password: " | |
send -- "myPassword\r" | |
expect "router>" | |
send -- "enable\r" | |
expect -re "password: |Password: " | |
send -- "myEnablePassword\r" | |
expect "router#" | |
send -- "terminal length 0\r" | |
expect "router#" | |
send -- "show run\r" | |
expect "router#" | |
send -- "show access-lists\r" | |
expect "router#" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment