Netwatch find interface for an IP address disable eneble it

I tried to write a universal script for netwatch.
In case of a “disable” result, I want to additionally perform 10 pings, if the result is the same “disable” then find out which interface the IP address is on, then turn off the interface for 30 seconds and turn it back on.

I could not figure out how to get the interface name for the IP address in the netwatch “$host”

Please, help solve this problem

Well, $host could be remote/off-router, do mean the outbound route $host would take?

If so, there used to be “/ip route check” that calculate the routing results. In the “new & improved” routing in V7, this was helpful command was removed.
I have most of script to do this however, I don’t regularly use it & not quite what your looking for, so perhaps an example:
http://forum.mikrotik.com/t/ip-route-check-command-disappeared/141645/1