Skip to content

Instantly share code, notes, and snippets.

@dd-han
Created December 26, 2016 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dd-han/c49fee3209d69cfebcb3f9c9aa3ea6de to your computer and use it in GitHub Desktop.
Save dd-han/c49fee3209d69cfebcb3f9c9aa3ea6de to your computer and use it in GitHub Desktop.
small watchdog
#!/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