cf-ddns.sh
cf-ddns.sh copied to clipboard
Turning off proxy
When running script it turns off Proxy (Turns cloud to grey) How can i stop this?
Thanks dan
This appears to be a bug in cf-ddns.sh. I hadn't noticed this behavior before, but it looks like if you do an update to the DNS record without specifying the proxy state, it defaults to off. I will work on a fix. Good catch!
As a quick and dirty workaround, you can change the end of line 269 to --data "{"id":"${zone_id}","type":"A","name":"${record_name}","content":"${WAN_addr}", "proxiable":true,"proxied":true}"`
Brilliant, Appreciate it
Thank you
I did edit that comment, so make sure both "proxiable" and "proxied" are set to true in that line. Thanks for bringing this to my attention.
269 didn't work for me unless i done it wrong but what did work was just adding the proxy statements to this- tested with false and it turns proxy off, and also tested with true and it doesn't turn proxy off. (Unless you actually meant this line and the line number was wrong)
# Perform record update
api_dns_update=`${curl_command} -s -X PUT "${cf_api_url}/zones/${zone_id}/dns_records/${record_id}" -H "X-Auth-Email: ${cf_email}" -H "X-Auth-Key: ${cf_api_key}" -H "Content-Type: application/json" --data "{\"id\":\"${zone_id}\",\"type\":\"A\",\"name\":\"${record_name}\",\"content\":\"${WAN_addr}\", \"proxiable\":true,\"proxied\":true}"`