Skip to content

Instantly share code, notes, and snippets.

@vncloudsco
Created June 7, 2020 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vncloudsco/cf61a8f2e50ffb1589bd887c8a08c66a to your computer and use it in GitHub Desktop.
Save vncloudsco/cf61a8f2e50ffb1589bd887c8a08c66a to your computer and use it in GitHub Desktop.
#!/bin/bash
ip=$(printf "%q" $1)
no=$(printf "%q" $6)
curl -X POST "https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules" -H "X-Auth-Email: YOU@YOUREMAIL.COM" -H "X-Auth-Key: YOURCLOUDFLAREAUTHCODE" -H "Content-Type: application/json" --data '{"mode":"block","configuration":{"target":"ip","value":"'$ip'"},"notes":"fromcsflfd"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment