I've tested your fine script and found two major issues with it
1. It will just "bounce" between gateways for me. As I see it, script will test
for availability with icmp but as it fails on primary gw targets are once again
reachable from secondary and the script once again switch to primary!? Are you
sure you can test without -I ping command option and get desired behavior?
2. Default value of MAX_LATENCY is total overkill, ping will just stall if
default gw isn't available on primary interface which is most probable cause of
failure.
Best regards,
Nikola
Original issue reported on code.google.com by
nbjeli...@gmail.comon 29 Nov 2012 at 9:50