Skip to content

Commit

Permalink
fix for cf api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhotio committed Feb 1, 2025
1 parent efcacc1 commit c6e0d24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/app/cloudflare-ddns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ while true; do
logger "No DNS record was returned!" ERROR
elif [[ $(jq -r '.success' <<< "${response}") == true ]]; then
logger "Response:\n$(jq . <<< "${response}")" DEBUG
dnsrecord=$(jq -r '.result[0] | {name, id, zone_id, zone_name, content, type, proxied, ttl}' <<< "${response}")
dnsrecord=$(jq -r --arg id "${zoneid}" --arg name "${host}" '.result[0] | {name, id, zone_id, zone_name, content, type, proxied, ttl} | .zone_id = $id | .zone_name = $name' <<< "${response}")
logger "Writing DNS record to cache file [${cache}]." INFO
printf "%s" "${dnsrecord}" > "${cache}"
logger "Data written to cache:\n$(jq . <<< "${dnsrecord}")" DEBUG
Expand Down

0 comments on commit c6e0d24

Please sign in to comment.