Update cloudflare-template.sh

pull/51/head
MohairVomNipa 3 years ago committed by GitHub
parent a4e57871be
commit 7173165c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      cloudflare-template.sh

@ -46,6 +46,12 @@ fi
## Seek for the A record ## Seek for the A record
########################################### ###########################################
logger "DDNS Updater: Check Initiated"
record=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records?type=A&name=$record_name" \
-H "X-Auth-Email: $auth_email" \
-H "$auth_header $auth_key" \
-H "Content-Type: application/json")
logger "DDNS Updater: Check Initiated" logger "DDNS Updater: Check Initiated"
record=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records?type=A&name=$record_name" \ record=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records?type=A&name=$record_name" \
-H "X-Auth-Email: $auth_email" \ -H "X-Auth-Email: $auth_email" \
@ -60,6 +66,11 @@ if [[ $record == *"\"count\":0"* ]]; then
exit 1 exit 1
fi fi
if [[ $record == *"\"count\":0"* ]]; then
logger -s "DDNS Updater: Record does not exist, perhaps create one first? (${ip} for ${record_name})"
exit 1
fi
########################################### ###########################################
## Get existing IP ## Get existing IP
########################################### ###########################################

Loading…
Cancel
Save