commit e8bca02557ac91a0418d389346a03532b43d72f7 Author: Wesley van Tilburg Date: Tue Jan 7 11:25:46 2025 +0000 feat: Add script to dump transip domain records 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 +