Advertisement
rootplg3544

script automatic smatphone limit yang telah disederhanakan B

Jul 2nd, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 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 where (host-name~"android" || host-name~"iPhone" || host-name~"Redmi" || host-name~"Galaxy")] 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. /queue simple remove [find name~"Smartphone"]
  16.  
  17. :foreach i in=[/ip firewall address-list find] do={
  18. :set list ([/ip firewall address-list get $i list] )
  19. :set hostip ([/ip firewall address-list get $i address] )
  20. :set testvalue [/queue simple find name=$hostip]
  21. :if ([:len $testvalue] <= 0) do={
  22. :if ($list = "smartphone-ip") do={
  23. /queue simple add name="Smartphone $hostip" target=$hostip max-limit=0/896k
  24. }
  25. }
  26. }
  27.  
  28. /system logging enable 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement