Created
May 11, 2017 23:07
-
-
Save akatrevorjay/f84180170461df19e4895f47461bb152 to your computer and use it in GitHub Desktop.
check-url
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 | |
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