From e8bca02557ac91a0418d389346a03532b43d72f7 Mon Sep 17 00:00:00 2001 From: Wesley van Tilburg Date: Tue, 7 Jan 2025 11:25:46 +0000 Subject: [PATCH] feat: Add script to dump transip domain records --- dns/transip-dumpdns.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 dns/transip-dumpdns.sh diff --git a/dns/transip-dumpdns.sh b/dns/transip-dumpdns.sh new file mode 100755 index 0000000..6a0715d --- /dev/null +++ b/dns/transip-dumpdns.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +##Dump all dns records for transip domains to a file +## example: ./transip-dumpdns "mycooltoken" "domain1.tld domain2.tld" +## requires curl,jq + + +token="$1" +domains="$2" + +mkdir -p ./domains + +for domain in $domains +do + url="https://api.transip.nl/v6/domains/$domain/dns" + echo "dumping domain: $domain" + + data="$(curl -s -H "Authorization: Bearer $token" $url | jq -r '.dnsEntries' )" + echo "$data" >> ./domains/"$domain".json +done +