diff options
author | Florian Eckert <fe@dev.tdt.de> | 2020-11-27 09:17:58 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2020-11-28 11:07:14 +0100 |
commit | 733e6508f3e763c315b41f21a3f44a33198b7a84 (patch) | |
tree | c3025889019a6a08072f5f63c6c3b2e27581adf9 /net/ddns-scripts/files/usr/lib | |
parent | 84f20951b32b8652c3fce37c23d795583718ac84 (diff) |
ddns-scripts: add gandi.net provider
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'net/ddns-scripts/files/usr/lib')
1 files changed, 20 insertions, 0 deletions
diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh b/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh new file mode 100644 index 000000000..553e7e7aa --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Thanks goes to Alex Griffin who provided this script. + +local __TTL=600 +local __RRTYPE +local __ENDPOINT="https://dns.api.gandi.net/api/v5" + +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing subdomain as 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing API Key as 'password'" + +[ $use_ipv6 -ne 0 ] && __RRTYPE="AAAA" || __RRTYPE="A" + +curl -s -X PUT "$__ENDPOINT/domains/$domain/records/$username/$__RRTYPE" \ + -H "X-Api-Key: $password" \ + -H "Content-Type: application/json" \ + -d "{\"rrset_ttl\": $__TTL, \"rrset_values\": [\"$__IP\"]}" >$DATFILE + +write_log 7 "gandi.net answered: $(cat $DATFILE)" + +return 0 |