Created
April 7, 2018 23:06
-
-
Save RayBB/18c12d73679f8c726c2c0a36bfd7db87 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
echo "this must be run as sudo to work" | |
for (( ; ; )) | |
do | |
if ping -q -c 1 -W 1 208.67.222.222 >/dev/null; then | |
echo "IPv4 is up" | |
sleep 60 | |
else | |
echo "IPv4 is down, restarting network service" | |
sudo service network-manager restart | |
sleep 60 | |
fi | |
done | |
## This bash script should check for internet every 60 seconds and restart the service if it's not found |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment