bdcom_epon_if_inactiveonu 575 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #
  2. # EPON interface inactive ONU display
  3. #
  4. if {[llength $argv] != 5} {
  5. puts "Usage: ip username password enablepassword interface"
  6. exit 1
  7. }
  8. set timeout 30
  9. set ip [lindex $argv 0]
  10. set login [lindex $argv 1]
  11. set password [lindex $argv 2]
  12. set enable [lindex $argv 3]
  13. set iface [lindex $argv 4]
  14. spawn telnet $ip
  15. expect "Username:*"
  16. send "$login\r"
  17. expect "Password:*"
  18. send "$password\r"
  19. expect "*>"
  20. send "enable\r"
  21. expect "*#"
  22. send "terminal length 0\r"
  23. expect "*#"
  24. send "show epon inactive-onu interface $iface\r"
  25. expect "*#"
  26. send "exit\r"
  27. expect "*>"
  28. send "exit\r"