Created
August 9, 2022 07:28
-
-
Save nobiit/fa093e12e931057b9bbda35f020b18b4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -e | |
DOMAIN=${1} | |
URI=${2} | |
printf "Testing HTTP Status for %s ...\n" ${DOMAIN} | |
for item in $(dig +short ${DOMAIN} | sort); do | |
if [[ ${item} =~ ^[0-9.]+$ ]]; then | |
printf "%15s ..... " ${item} | |
status=$(curl -s -I -o /dev/null -w "%{http_code}" --resolve "${DOMAIN}:443:${item}" https://${DOMAIN}/${URI} || true) | |
if [ ${status} == 200 ]; then | |
echo OK | |
else | |
echo ${status} | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment