
Code: Select all
#!/bin/bash
/usr/bin/ping -c 1 123.123.123.123 > /dev/null
if [ $? -eq 0 ]; then
echo "Ping ok"
else
echo "Ping Failed"
/usr/local/bin/ipsecctrl S
echo "IPSEC restarded on "$(date +%d-%m-%Y-"%T") >> /root/logfile.log
fi
Now i have resaved the ipsec configuration and now it restarts after 6 hours
IPSEC restarded on 21-02-2013-23:15:13
IPSEC restarded on 22-02-2013-21:05:13
IPSEC restarded on 23-02-2013-09:05:13
IPSEC restarded on 23-02-2013-15:10:13
IPSEC restarded on 24-02-2013-09:05:13
IPSEC restarded on 24-02-2013-15:10:13
IPSEC restarded on 24-02-2013-21:15:13