Created
July 12, 2015 15:19
-
-
Save riccardobl/b4bf4b9d8e884c796a71 to your computer and use it in GitHub Desktop.
Update records' ips of cloudflare using bash
This file contains hidden or 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/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