Last active
August 17, 2017 08:51
-
-
Save tzurbaev/3c75a3c5049b31fe98be9f15a29b15e5 to your computer and use it in GitHub Desktop.
Is website up?
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 -e "\E[1;33mIs ${1:-google.com} up?" | |
isUpResult=$(curl -sS http://downforeveryoneorjustme.com/${1:-google.com}) | |
if [[ $isUpResult == *"It's just you."* ]]; then | |
echo -e "\E[1;32mYep, ${1:-google.com} is up" | |
fi | |
if [[ $isUpResult == *"It's not just you!"* ]]; then | |
echo -e "\E[1;31mNope, ${1:-google.com} is down" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment