feat: Add script to dump transip domain records
This commit is contained in:
commit
e8bca02557
21
dns/transip-dumpdns.sh
Executable file
21
dns/transip-dumpdns.sh
Executable 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user