Check CloudFlare to see if records exist.

This commit is contained in:
Asif Bacchus 2018-09-12 03:19:10 -06:00
parent d403b124f1
commit 5ca04a5ecd

View File

@ -148,6 +148,14 @@ if [ -z "$ipAddress" ]; then
fi fi
## Check if desired record(s) exist at CloudFlare
for counter in "${dnsRecords[@]}"; do
record=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/ \
${cfDetails[2]}/dns_records?name=${dnsRecords[counter]}&type=A" \
-H "X-Auth-Email: ${cfDetails[0]}" \
-H "X-Auth-Key: ${cfDetails[1]}" \
-H "Content-Type: application/json")
done
### Echo results (testing) ### Echo results (testing)
echo -e "\nBased on parameters provided:" echo -e "\nBased on parameters provided:"