interrupted no such item

Hi there,
i’m trying to create a startup script that search for some ip on my mikrotik and if found then disable it.

It look like work properly but when the command “/ip address disable xx” the script hang with
interrupted no such item

the script run recursively until the ip is disabled or timer value become 120.


:local index -1
:local timer 0
:while ($timer!=120) do={

[set index -1; :foreach line in=[/ip address print detail as-value] do={

[set index ($index+1); set timer ($timer+1); :foreach part in=$line do={

[
:if ($part=“address=192.168.3.254/22”) do={
[/ip address disable $index; :set timer 120]};

]}
]}
]}

Try this, or why not just use the find function to search the IP addresses for you? The foreach may not run for the full 120, I’m not sure what goal you have with looping the script 120 times.
/ip address disable [find address=]


:foreach ENTRY in=[/ip firewall address find] do={}

Thank for your help.
Solved in other way, tomorrow post the script.

Bye