Last active
July 24, 2017 10:36
-
-
Save frnkst/fddf56637ce08325e032fab918e1100d to your computer and use it in GitHub Desktop.
Check if you are online or not
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 | |
wget -q --spider http://google.com | |
if [ $? -eq 0 ]; then | |
echo "Online" | |
else | |
echo "Offline" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment