Last active
October 8, 2016 16:55
-
-
Save chdsbd/59b45425b7f105576e45003614d4ca94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Clouflare's old v1 api - https://www.cloudflare.com/docs/client-api.html | |
IP=`dig +short myip.opendns.com @resolver1.opendns.com` | |
curl -X PUT https://api.cloudflare.com/client/v4/zones/<ZONE-ID>/dns_records/<REC-ID> \ | |
-H 'X-Auth-Email: <ACCOUNT-EMAIL>' \ | |
-H 'X-Auth-Key: <API-TOKEN>' \ | |
-H 'Content-Type: application/json' \ | |
--data '{ | |
"type": "A", | |
"name": "<SUBDOMAIN-NAME>", | |
"content": "'"$IP"'", | |
"proxied": false, | |
"ttl": 120 | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://api.cloudflare.com/