Created
August 20, 2018 19:18
-
-
Save Voronenko/85120eec3d1dcb39d5b71ed16d30123b to your computer and use it in GitHub Desktop.
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 | |
# * */6 * * * /etc/storage/scheduled_reboot.sh >/dev/null 2>&1 | |
echo --------------- --------------- --------------- -- | |
echo WAN CONTROL RESTART | |
echo --------------- --------------- --------------- -- | |
logger -t "di" "===========WAN CONTROL RESTART=====================" | |
PINGRESORCE1="bbc.com" | |
PINGRESORCE2="cnn.com" | |
PINGRESORCE3="google.com" | |
if (! ping -q -c3 ${PINGRESORCE1} > /dev/null 2>&1) | |
then | |
if (! ping -q -c3 ${PINGRESORCE2} > /dev/null 2>&1) | |
then | |
if (! ping -q -c3 ${PINGRESORCE3} > /dev/null 2>&1) | |
then | |
reboot | |
else | |
echo 'internet ok' | |
fi | |
else | |
echo 'internet ok' | |
fi | |
else | |
echo 'internet ok' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment