Hello,
I'm trying to figure out is there a way to do this with monit.
check a.b.c.d with icmp echo
if it's not alive
check x.y.z.d with icmp echo
if it's alive
exec /etc/init.d/openvpn
Basically, this should be a check of primary openvpn server. If it's ok, leave it be and do nothing. On the other hand, if check to primary fails, check something on the internet to see if internet link is down on backup location. If that's not true, start openvpn.
So if [ (a.b.c.d is not alive) and (x.y.z.d is alive)] start
openvpn.
Thank you all
Bojan