finding OSPF dead neighbor...

hello,

sometimes a wireless interface seems connected, but ospf is not running.
So, i want to disable/enable the interface.

the following command in a terminal returns the value 1

:put [:len [/routing ospf neighbor find router-id=10.100.17.0]]

when i try to execute this script, it always logs “OSPF neighbour NOT found !!!”

:if (:len [/routing ospf neighbor find router-id=10.100.17.0]  = 1) do={
:log warning "OSPF neighbour found !!" 
}
:log warning "OSPF neighbour NOT found !!!"

so, what going wrong ?

{
:if ([/routing ospf neighbor find router-id=10.100.17.0] = "") do={
    :log warning "OSPF neighbour not found !!"
    /interface wireless disable "name of interface"
    :delay 5s
    /interface wireless enable "name of interface"
    }
}

Hope this helps, however your OSPF problem is a bit odd. Does this happen to multiple links, as I never see this happening?

If it is not found the find command will return nothing. If you compare nothing with a specific value type like integer it wont work. Find reports either nothing or a print like ID for the items it finds.
It’s not weird, it is this way the language is implemented (afaik).