Skip to content

Instantly share code, notes, and snippets.

@akatrevorjay
Created May 11, 2017 23:07
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 akatrevorjay/f84180170461df19e4895f47461bb152 to your computer and use it in GitHub Desktop.
Save akatrevorjay/f84180170461df19e4895f47461bb152 to your computer and use it in GitHub Desktop.
check-url
#!/bin/bash
set -eo pipefail
reset="\e[0m"
red="\033[0;31m"
green="\033[0;32m"
for url in "$@"; do
if curl -sSLfo /dev/null "$url" >/dev/null 2>&1; then
echo -e "${green}GOOD" "$url" "${reset}"
else
echo -e "${red}FAIL:$?" "$url" "${reset}" >&2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment