/system script run 0
, то все ок./system/scripts
, то не работает. :foreach i in=[/ip dhcp-server lease find ] do={
:foreach v in={"droid";"hone";"edmi";"amsung";"alaxy";"eizu";"UAWEI";"EIZU"} do={
:if (([:len [:find [/ip dhcp-server lease get $i value-name=host-name] $v ]]!=0) and ( [:len [:find [/ip dhcp-server lease get $i value-name=active-server] "SSID" ]]!=0)) do={
:global mac [/ip dhcp-server lease get $i mac-address]
:global host [/ip dhcp-server lease get $i host-name]
:global macm ([:pick $mac 0 12] . "00:00")
:if ([/cap access-list find where mac-address=$macm]="") do={/caps-man access-list add mac-address=$macm mac-address-mask=FF:FF:FF:FF:00:00 ssid-regexp=SSID action=reject place-before=0 comment=$host}
:log info "Block $host"}}}
/ip dhcp-server lease {
:foreach i in=[find (active-server=SSID && status="bound")] do={
:local hostname [get $i host-name]
:local vendor [:toarray "droid,hone,edmi,amsung,alaxy,eizu,UAWEI,EIZU"]
:foreach n in=$vendor do={
:if ($hostname~"$n") do={
:local mac [get $i active-mac-address]
:local macm ([:pick $mac 0 12] . "00:00");
:if ([/caps-man access-list find where mac-address=$macm]="") do={
/caps-man access-list add mac-address=$macm mac-address-mask=FF:FF:FF:FF:00:00 ssid-regexp=SSID action=reject place-before=0 comment=$hostname
:log info "Block $hostname"
}
/ip dhcp-server lease remove $i
:log info "Deleted from DHCP $hostname $mac"
}
}
}
}