Expect Script for Cisco Devices
#!/usr/bin/expect
spawn ssh user@192.168.0.1
expect “user@192.168.0.1’s password:”
send “passwd\r”
expect “>”
send “en\r”
expect “Password:”
send “passwd\r”
expect “#”
send “conf t\r”
expect “#(config)”
send “wr m\r”
expect “#(config)”
Comments
Leave a Reply

