Created
February 21, 2020 19:29
-
-
Save cwjohnston/d09935f4b22d0976887c03057ed98254 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 | |
TOKEN="YOUR_TOKEN_HERE" # The API v2 OAuth token | |
ACCOUNT_ID="YOUR_ACCOUNT_ID_HERE" # Replace with your account ID | |
ZONE_ID="example.com" # The zone ID is the name of the zone (or domain) | |
RECORD_ID="42424242" # Replace with the Record ID | |
IP=`curl -s -4 v4.ifconfig.co` # or provide your own value | |
curl -H "Authorization: Bearer $TOKEN" \ | |
-H "Content-Type: application/json" \ | |
-H "Accept: application/json" \ | |
-X "PATCH" \ | |
-i "https://api.dnsimple.com/v2/$ACCOUNT_ID/zones/$ZONE_ID/records/$RECORD_ID" \ | |
-d "{\"content\":\"$IP\"}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment