2 # Thanks goes to Alex Griffin who provided this script.
6 local __ENDPOINT
="https://dns.api.gandi.net/api/v5"
8 [ -z "$username" ] && write_log
14 "Service section not configured correctly! Missing subdomain as 'username'"
9 [ -z "$password" ] && write_log
14 "Service section not configured correctly! Missing API Key as 'password'"
11 [ $use_ipv6 -ne 0 ] && __RRTYPE
="AAAA" || __RRTYPE
="A"
13 curl
-s -X PUT
"$__ENDPOINT/domains/$domain/records/$username/$__RRTYPE" \
14 -H "X-Api-Key: $password" \
15 -H "Content-Type: application/json" \
16 -d "{\"rrset_ttl\": $__TTL, \"rrset_values\": [\"$__IP\"]}" >$DATFILE
18 write_log
7 "gandi.net answered: $(cat $DATFILE)"