1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | :local hostip :local list :local testvalue /system logging disable 0 /ip firewall address-list remove [find list~"smartphone-ip"] :delay 1 :foreach i in=[/ip dhcp-server lease find host-name~"android"] do={ :local hostIPlist [/ip dhcp-server lease get $i value-name=address] /ip firewall address-list add address=$hostIPlist list="smartphone-ip" } :foreach i in=[/ip dhcp-server lease find host-name~"iPhone"] do={ :local hostIPlist [/ip dhcp-server lease get $i value-name=address] /ip firewall address-list add address=$hostIPlist list="smartphone-ip" } :foreach i in=[/ip dhcp-server lease find host-name~"Redmi"] do={ :local hostIPlist [/ip dhcp-server lease get $i value-name=address] /ip firewall address-list add address=$hostIPlist list="smartphone-ip" } :foreach i in=[/ip dhcp-server lease find host-name~"Galaxy"] do={ :local hostIPlist [/ip dhcp-server lease get $i value-name=address] /ip firewall address-list add address=$hostIPlist list="smartphone-ip" } /queue simple remove [find name~"Smartphone"] :foreach i in=[/ip firewall address-list find] do={ :set list ([/ip firewall address-list get $i list] ) :set hostip ([/ip firewall address-list get $i address] ) :set testvalue [/queue simple find name=$hostip] :if ([:len $testvalue] <= 0) do={ :if ($list = "smartphone-ip") do={ /queue simple add name="Smartphone $hostip" target=$hostip max-limit=0/896k /queue simple move [find name="Smartphone $hostip"] [:pick [find] 0] } } } |