Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/expect -f
- set ip [lindex $argv 0]
- set login [lindex $argv 1]
- set passwd [lindex $argv 2]
- set cfg_server [lindex $argv 3]
- set enable_passwd [lindex $argv 4]
- set cur_date [lindex $argv 5]
- spawn telnet $ip\n
- expect "ame: " {send "$login\n"}
- expect "ord: " {send "$passwd\n"}
- expect ">" {send "enable\n"}
- expect "ord: " {send "$enable_passwd\n"}
- expect "#" {send "configure terminal\n"}
- expect "(config)#" {send "ip dhcp snooping\n"}
- expect "(config)#" {send "ip dhcp snooping vlan 629\n"}
- expect "(config)#" {send "exit\n"}
- expect "]?" {send "wr mem\n"}
- expect "]?" {send "logout\n"}
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement