Skip to content

Instantly share code, notes, and snippets.

@dd-han
Created December 26, 2016 06:07
Embed
What would you like to do?
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