From 40c8f8269238a4ba28dccd619551c370c42858dd Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 6 Feb 2020 01:09:01 +0100 Subject: addad gandi-update --- scripts/gandi-update | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/gandi-update (limited to 'scripts') diff --git a/scripts/gandi-update b/scripts/gandi-update new file mode 100755 index 0000000..496eb9c --- /dev/null +++ b/scripts/gandi-update @@ -0,0 +1,15 @@ +#!/bin/bash + +APIKEY= +TTL=1800 +DOMAIN= +RECORD= +TYPE=A + +IP=$(dig -4 +short myip.opendns.com @resolver1.opendns.com) + +REQUEST="{\"rrset_ttl\": $TTL, \"rrset_values\": [\"$IP\"]}" +URL="https://dns.api.gandi.net/api/v5/domains/$DOMAIN/records/$RECORD/$TYPE" + +curl -D- -X PUT -H "Content-Type: application/json" -H "X-Api-Key: $APIKEY" -d "$REQUEST" $URL + -- cgit v1.2.3