Last active
April 10, 2019 06:53
-
-
Save euyuil/36e4402c50f1f6adf183a9411b5305a2 to your computer and use it in GitHub Desktop.
Gandi.net: Dynamic DNS crontab script
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 | |
# https://doc.livedns.gandi.net/ | |
# https://www.ipify.org/ | |
APIKEY='YourKeyGoesHere' | |
DOMAIN='example.com' | |
NAME='@' | |
IPADDR=`curl -s https://api.ipify.org/` | |
curl -s -X PUT \ | |
-H "Content-Type: application/json" \ | |
-H "X-Api-Key: $APIKEY" \ | |
-d "{\"rrset_ttl\":300,\"rrset_values\":[\"$IPADDR\"]}" \ | |
https://dns.api.gandi.net/api/v5/domains/$DOMAIN/records/$NAME/A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment