|
|
@ -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 |
|
|
|
########################################### |
|
|
|
########################################### |
|
|
|