Skip to content

Commit 4a9926d

Browse files
author
Jayother24
authored
Create Y
1 parent 235e0c7 commit 4a9926d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Y

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
TOKEN="xxxxxxxxxxxxxxxxxxx"
4+
ZONE_ID=2222222222222222222222222
5+
6+
7+
# KEY=11111111111111111111111111
8+
# Replace with
9+
# -H "X-Auth-Email: ${EMAIL}" \
10+
# -H "X-Auth-Key: ${KEY}" \
11+
# for old API keys
12+
13+
14+
curl -s -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
15+
-H "Authorization: Bearer ${TOKEN}" \
16+
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (
17+
while read id; do
18+
curl -s -X DELETE https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${id} \
19+
-H "Authorization: Bearer ${TOKEN}" \
20+
-H "Content-Type: application/json"
21+
done
22+
)

0 commit comments

Comments
 (0)