Skip to content

Instantly share code, notes, and snippets.

@florinel-chis
Created October 5, 2013 14:11
Show Gist options
  • Save florinel-chis/6841366 to your computer and use it in GitHub Desktop.
Save florinel-chis/6841366 to your computer and use it in GitHub Desktop.
purge file on cloudflare
if [ -z "$1" ]; then
echo "Usage: $0 http://your.domain.com/url"
exit 0
fi
#get this from Account section in Cloudflare
TOKEN="YOUR_TOKEN_HERE"
EMAIL="YOUR_EMAIL_HERE"
DOMAIN="YOUR_DOMAIN_HERE"
curl https://www.cloudflare.com/api_json.html \
-d "a=zone_file_purge" \
-d "tkn=$TOKEN" \
-d "email=$EMAIL" \
-d "z=$DOMAIN" \
-d "url=$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment