#!/bin/bash
DEST="10.3.5.2"
ping -c4 ${DEST} > /dev/null
if [ $? != 0 ]
then
echo "$(date): cannot ping ${DEST}, rebooting now..." >> /opt/openvpn/scripts/reboot-if-ping-fails.log
/sbin/shutdown -r now
fi