Skip to content

Instantly share code, notes, and snippets.

@riccardobl
Created July 12, 2015 15:19
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 riccardobl/b4bf4b9d8e884c796a71 to your computer and use it in GitHub Desktop.
Save riccardobl/b4bf4b9d8e884c796a71 to your computer and use it in GitHub Desktop.
Update records' ips of cloudflare using bash
#!/bin/sh
ip=$(curl https://wtfismyip.com/text)
# For api documentation see https://www.cloudflare.com/docs/client-api.html
curl https://www.cloudflare.com/api_json.html \
-d 'a=rec_edit' \
-d 'tkn=XXXXXXXXXXXXXXXXXXXX' \
-d 'email=XXXXXXXXXXXXXXXXXXXX' \
-d 'z=XXXXXXXXXXXXXXXXXXXX' \
-d 'id=XXXXXXXXXXXXXXXXXXXX' \
-d 'type=A' \
-d 'name=XXXXXXXXXXXXXXXXXXXX' \
-d 'ttl=1' \
-d "content=$ip"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment