Skip to content

Instantly share code, notes, and snippets.

@ghazlewood
Created September 5, 2017 15:56
Show Gist options
  • Save ghazlewood/ad45336095d12a31b790b81b4cb27898 to your computer and use it in GitHub Desktop.
Save ghazlewood/ad45336095d12a31b790b81b4cb27898 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# check the bare domain IP against the current CDN hostnames
#
# edit me!
DOMAIN=hiscoxbroker.co.uk
# gather details
BAREIP=`dig a $DOMAIN +short`
CDN=`dig $DOMAIN.cdn.cloudflare.net +short`
# compare
if [[ $CDN != *$BAREIP* ]]; then
echo "boop boop, bare domain not a CDN load balancer IP!"
#else
# echo "do nothing"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment