Can I use results of ping in an script to reset interface?

Hi all.

Is that posible? How to read ping results to an ip address and using “if” command reset interface. I mean scenario when mikrotik ping IP address to remote location and when have no responce reseting interface connected to those location.

use netwatch to trigger a script, it uses ping to determine up/down status.

Sam