Skip to content

Instantly share code, notes, and snippets.

@glarrain
Created October 17, 2012 12:42
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 glarrain/3905336 to your computer and use it in GitHub Desktop.
Save glarrain/3905336 to your computer and use it in GitHub Desktop.
Test whether each of the domains in the list is up or not
#!/usr/bin/env sh
# Uses curl to connect to www.isup.me, a website that checks if a given domain
# is up or not. The response will contain "It's just you" if the domain is up.
# If not, it will contain "It's not just you".
test $# -lt 1 && (echo "Usage: $0 domain [domain2] [domain3] ..."; exit 1;)
for domain in "$@"; do
echo -n "$domain: "
(curl -s "http://www.isup.me/$domain" | grep "It's just you." 1>/dev/null) && echo "It's just you" || echo "It's down"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment