Izya12

comd_C1.sh

Sep 11th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.46 KB | None | 0 0
  1. #!/usr/bin/expect -f
  2. set IP [lindex $argv 0]
  3. set COMD1 [lindex $argv 1]
  4. set COMD2 [lindex $argv 2]
  5. set COMD3 [lindex $argv 3]
  6. set timeout -1
  7. spawn ping -c 2 -i 3 -W 1 $IP
  8. spawn telnet $IP
  9. match_max 100000
  10. expect "*ser*ame:"
  11. # Посылаем имя пользователя и ждем запроса пароля.
  12. send "robot\r"
  13. expect "*ass*ord:"
  14. # Посылаем пароль и ждем приглашения ввода командного интерпретатора.
  15. send "7kArzIITio\r"
  16. set timeout -1
  17. expect "*#"
  18. send "create mcast_filter_profile profile_id 1 profile_name full_pool_iptv\r"
  19. expect "*#"
  20. send "config mcast_filter_profile profile_id 1 add 224.1.1.0-224.1.1.255\r"
  21. expect "*#"
  22. send "config mcast_filter_profile profile_id 1 add 230.11.11.0-230.11.11.255\r"
  23. expect "*#"
  24. send "config mcast_filter_profile profile_id 1 add 224.20.0.52\r"
  25. expect "*#"
  26. send "config mcast_filter_profile profile_id 1 add 224.50.0.50-224.50.0.51\r"
  27. expect "*#"
  28. send "config mcast_filter_profile profile_id 1 add 225.10.10.16\r"
  29. expect "*#"
  30. send "config mcast_filter_profile profile_id 1 add 225.50.50.130-225.50.50.141\r"
  31. expect "*#"
  32. send "config mcast_filter_profile profile_id 1 add 229.99.99.140\r"
  33. expect "*#"
  34. send "config mcast_filter_profile profile_id 1 add 227.1.1.0-227.1.1.255\r"
  35. expect "*#"
  36. send "$COMD1\r"
  37. expect "*#"
  38. send "$COMD2\r"
  39. expect "*#"
  40. send "$COMD3\r"
  41. expect "*#"
  42. send "save all\r"
  43. expect "*#"
  44. send "logout\r"
  45. expect eof
Advertisement
Add Comment
Please, Sign In to add comment