feat: update zones

This commit is contained in:
Jan-Ole Hübner 2024-01-14 04:46:37 +01:00
parent 1ec1d0f3c5
commit 9a1cbf4f94
2 changed files with 32 additions and 1 deletions

22
delete_records.sh Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash
TOKEN=""
ZONE_ID=
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
# for old API keys
curl -s -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (
while read id; do
curl -s -X DELETE https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${id} \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json"
done
)