Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/usr/bin/expect -f
  2. set ip [lindex $argv 0]
  3. set login [lindex $argv 1]
  4. set passwd [lindex $argv 2]
  5. set cfg_server [lindex $argv 3]
  6. set enable_passwd [lindex $argv 4]
  7. set cur_date [lindex $argv 5]
  8.  
  9. spawn telnet $ip\n
  10. expect "ame: " {send "$login\n"}
  11. expect "ord: " {send "$passwd\n"}
  12. expect ">" {send "enable\n"}
  13. expect "ord: " {send "$enable_passwd\n"}
  14. expect "#" {send "configure terminal\n"}
  15. expect "(config)#" {send "ip dhcp snooping\n"}
  16. expect "(config)#" {send "ip dhcp snooping vlan 629\n"}
  17. expect "(config)#" {send "exit\n"}
  18. expect "]?" {send "wr mem\n"}
  19. expect "]?" {send "logout\n"}
  20.  
  21. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement