Created
September 5, 2017 15:58
-
-
Save ghazlewood/56ad8c641b260b25431059e39fe4e440 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
# | |
# check the bare domain IP against the current CDN hostnames | |
# | |
# edit me! | |
DOMAINS=array( 'hiscoxbroker.co.uk' 'hiscox.de' 'hiscox.ie' ) | |
for DOMAIN in "${DOMAINS[@]};" do | |
echo "checking $DOMAIN" | |
# gather details | |
BAREIP=`dig a $DOMAIN +short` | |
CDN=`dig $DOMAIN.cdn.cloudflare.net +short` | |
# compare | |
if [[ $CDN != *$BAREIP* ]]; then | |
echo "boop boop, bare domain for $DOMAIN is not a CDN load balancer IP!" | |
# else | |
# echo "do nothing" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment