You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
703 B

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