Created
May 12, 2014 16:52
-
-
Save rustymyers/f2b44e8a56d1792e49e2 to your computer and use it in GitHub Desktop.
Check for network
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
# Check for active connection | |
while [ "$NETACTIVE" == 'FALSE' ]; do | |
# If block to test internet availability | |
if ping -nc 3 8.8.8.8 | grep '100.0%' >/dev/null 2>&1;then | |
/bin/echo $(date) "failed to connect to server" | |
exit 1 | |
else | |
/bin/echo $(date) "Success connecting to server" | |
# Do stuff here | |
NETACTIVE=TRUE | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment