Created
December 26, 2016 06:07
-
-
Save dd-han/c49fee3209d69cfebcb3f9c9aa3ea6de to your computer and use it in GitHub Desktop.
small watchdog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
failLog='/opt/vpnfail.log' | |
sleep 60 | |
while [ 1 ]; do | |
if curl -k https://127.0.0.1/ > /dev/null;then | |
date | |
echo 'vpnserver fine' | |
else | |
echo -n 'vpnserver fail at ' > ${failLog} | |
date > ${failLog} | |
reboot | |
fi | |
sleep 120 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment