Misc-scripts/dns/transip-dumpdns.sh

22 lines
444 B
Bash
Raw Normal View History

#!/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