Here is the original script in the wiki:
:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 72.14.207.104 interval=3 count=1]=0)};
:if ($i=5 && [/ip route get [find comment="Default Route"] disabled]=false) do={:log info "Main Gateway down";
/ip route set [find comment="Default Route"] disabled=yes}
:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 72.14.207.104 interval=3 count=1]=1)};
:if ($i=5 && [/ip route get [find comment="Default Route"] disabled]=true) do={:log info "Main Gateway up";
/ip route set [find comment="Default Route"] disabled=no}
These scripts did not work for me and ether 1 was the interface I was trying to control. I also changed the IP address to DNS server IP that we use outside our network. Here is my script which will make it failover if the DNS is not reachable but when ether 1 is back up it won't switch back from ether 8. Since it is disabled it doesn't see any farther than the dsl modem. I just paste this in netwatch, changed ping to 100ms and interval of 3ms. Please tell me what to do. Thanks
:local i 0;:if [/ip route get [find comment="Default Route"] disabled]=false) do={:log info "Main Gateway down";
/ip route set [find comment="Default Route"] disabled=yes}
:local i 0; :if [/ip route get [find comment="Default Route"] disabled]=true) do={:log info "Main Gateway up";
/ip route set [find comment="Default Route"] disabled=no}