Advertisement
rootplg3544

Smartphone Scrip

Jul 2nd, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. :local hostip
  2. :local list
  3. :local testvalue
  4.  
  5. /system logging disable 0
  6.  
  7. /ip firewall address-list remove [find list~"smartphone-ip"]
  8. :delay 1
  9.  
  10. :foreach i in=[/ip dhcp-server lease find host-name~"android"] do={
  11. :local hostIPlist [/ip dhcp-server lease get $i value-name=address]
  12. /ip firewall address-list add address=$hostIPlist list="smartphone-ip"
  13. }
  14.  
  15. :foreach i in=[/ip dhcp-server lease find host-name~"iPhone"] do={
  16. :local hostIPlist [/ip dhcp-server lease get $i value-name=address]
  17. /ip firewall address-list add address=$hostIPlist list="smartphone-ip"
  18. }
  19.  
  20. :foreach i in=[/ip dhcp-server lease find host-name~"Redmi"] do={
  21. :local hostIPlist [/ip dhcp-server lease get $i value-name=address]
  22. /ip firewall address-list add address=$hostIPlist list="smartphone-ip"
  23. }
  24.  
  25. :foreach i in=[/ip dhcp-server lease find host-name~"Galaxy"] do={
  26. :local hostIPlist [/ip dhcp-server lease get $i value-name=address]
  27. /ip firewall address-list add address=$hostIPlist list="smartphone-ip"
  28. }
  29.  
  30. /queue simple remove [find name~"Smartphone"]
  31.  
  32. :foreach i in=[/ip firewall address-list find] do={
  33. :set list ([/ip firewall address-list get $i list] )
  34. :set hostip ([/ip firewall address-list get $i address] )
  35. :set testvalue [/queue simple find name=$hostip]
  36. :if ([:len $testvalue] <= 0) do={
  37. :if ($list = "smartphone-ip") do={
  38. /queue simple add name="Smartphone $hostip" target=$hostip max-limit=0/896k
  39. /queue simple move [find name="Smartphone $hostip"] [:pick [find] 0]
  40. }
  41. }
  42. }
  43.  
  44. /system logging enable 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement