bdcom_epon_if_tflush 768 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # EPON interface all ONU flush/deregister
  3. #
  4. if {[llength $argv] != 5} {
  5. puts "Usage: ip username password enablepassword interface"
  6. exit 1
  7. }
  8. set timeout 60
  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 "config\r"
  25. expect "*#"
  26. send "interface $iface\r"
  27. for {set i 1} {$i <= 64} {incr i} {
  28. expect "*#"
  29. send "no epon bind-onu sequence $i\r"
  30. }
  31. expect "*#"
  32. send "exit\r"
  33. expect "*#"
  34. send "exit\r"
  35. expect "*#"
  36. send "write all\r"
  37. expect "*#"
  38. send "exit\r"
  39. expect "*>"
  40. send "exit\r"