Skip to content

Instantly share code, notes, and snippets.

@tzurbaev
Last active August 17, 2017 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzurbaev/3c75a3c5049b31fe98be9f15a29b15e5 to your computer and use it in GitHub Desktop.
Save tzurbaev/3c75a3c5049b31fe98be9f15a29b15e5 to your computer and use it in GitHub Desktop.
Is website up?
#!/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