Skip to content

Instantly share code, notes, and snippets.

@Voronenko
Created August 20, 2018 19:18
Show Gist options
  • Save Voronenko/85120eec3d1dcb39d5b71ed16d30123b to your computer and use it in GitHub Desktop.
Save Voronenko/85120eec3d1dcb39d5b71ed16d30123b to your computer and use it in GitHub Desktop.
#!/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