/interface bridge host
:foreach item in=[find] do={
:local iface [get $item interface]
:local macadd [get $item mac-address]
:local idmac [/ip arp find where mac-address=$macadd]
:if ([:len $idmac] = 1) do={
:local ifip [/ip arp get $idmac address]
:put "interface=$iface mac=$macadd ip=$ifip"
}
}
nice to see that ; ; ; ; and (""."".""."") is not used, very well!!
useless local ip, if the script must not interact with other parts
do not use reserved words, or like so, for variables names
missing
where
useless quoted $mac
find can give more than one IP by same MAC address
get not work with array, only with only one element array (of one ID) or ID
> 0 go to = 1, if more than one is present, must be used again a
:foreach itm in=$idmac cycle
Can still do error if ARP entry is dynamically removed betwen the two "/ip arp" instructions because
get not find the entry