Last active
May 27, 2022 19:06
-
-
Save lewiswalsh/46cb8a4d19dcb1477f648b6969316038 to your computer and use it in GitHub Desktop.
Update DigitalOcean domain record from bash #bash
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 | |
# Use CRON to regularly update for DIY DynDNS | |
PUBLIC_IPV4=$(curl ifconfig.co) | |
API_ACCESS_TOKEN=<your_access_token> | |
RECORD_ID=<your_record_id> | |
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${API_ACCESS_TOKEN}" -d '{"data":"'"${PUBLIC_IPV4}"'"}' "https://api.digitalocean.com/v2/domains/centralindustrial.co.uk/records/${RECORD_ID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment