feat: Add script to dump transip domain records

This commit is contained in:
Wesley van Tilburg 2025-01-07 11:25:46 +00:00
commit e8bca02557

21
dns/transip-dumpdns.sh Executable file
View File

@ -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