#!/bin/bash
# make sure the wan is functioning
ping -c 3 -i 3 8.8.8.8
if [ $? -ne 0 ]; then
exit 1
fi
# check the vpn tunnel
ping -c 5 -i 5 5.5.0.1
if [ $? -ne "0" ]; then
killall openvpn
sleep 10
openvpn /etc/openvpn/debug.ovpn &
fi
