Skip to content

Instantly share code, notes, and snippets.

@ejholmes
Last active February 24, 2017 05:28
Show Gist options
  • Save ejholmes/21260f9a771869a4ca0736d1b94d84f3 to your computer and use it in GitHub Desktop.
Save ejholmes/21260f9a771869a4ca0736d1b94d84f3 to your computer and use it in GitHub Desktop.
Check if a website is served through CloudFlare.
#!/bin/bash
domain=$1
if [[ -z "$(dig +short NS $domain | grep cloudflare)" ]]; then
printf "\033[0;32mOK\033[0m\n"
else
printf "\033[0;31mAFFECTED\033[0m\n"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment