From 733e6508f3e763c315b41f21a3f44a33198b7a84 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 27 Nov 2020 09:17:58 +0100 Subject: ddns-scripts: add gandi.net provider Signed-off-by: Florian Eckert --- .../files/usr/lib/ddns/update_gandi_net.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh (limited to 'net/ddns-scripts/files/usr/lib') 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 -- cgit v1.2.3