-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns
33 lines (28 loc) · 1.02 KB
/
dns
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Debian and Ubuntu VPS Installer
# Script by Juan
#
# Illegal selling and redistribution of this script is strictly prohibited
# Please respect author's Property
# Binigay sainyo ng libre, ipamahagi nyo rin ng libre.
#
#
# Now check if our machine is in root user, if not, this script exits
# If you're on sudo user, run `sudo su -` first before running this script
if [[ $EUID -ne 0 ]];then
ScriptMessage
echo -e "[\e[1;31mError\e[0m] This script must be run as root, exiting..."
exit 1
fi
read -p "Enter Cloudflare DNS Token:" TOKEN
read -p "Enter Cloudflare ZONE ID:" ZONE_ID
curl -s -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=1000 \
-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
)
rm -f dns*