D34DC3N73R
Occasional Visitor
I've used the DDNS sample script for cloudflare, but it doesn't seem to be working and I'm not seeing enough detail to figure out why it's not working. I have an RT-AC88U on 380.69
/jffs/scripts/ddns-start
When running the script or saving the DDNS section, I get a warning prompt "Request error! Please try again."
The system log shows:
Mar 17 18:56:31 rc_service: watchdog 617:notify_rc start_ddns
Mar 17 18:56:31 custom_script: Running /jffs/scripts/ddns-start (args: xxx.xxx.xxx.xxx)
Mar 17 18:56:33 ddns: Custom ddns update failed
/jffs/scripts/ddns-start
Code:
#!/bin/sh
EMAIL="admin@domain.tld"
ZONEID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
RECORDID="xxxxxxxxxx"
RECORDNAME="domain.tld"
API="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
IP=${1}
curl -fs -o /dev/null -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID" \
-H "X-Auth-Email: $EMAIL" \
-H "X-Auth-Key: $API" \
-H "Content-Type: application/json" \
--data "{\"type\":\"A\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":120,\"proxied\":false}"
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
When running the script or saving the DDNS section, I get a warning prompt "Request error! Please try again."
The system log shows:
Mar 17 18:56:31 rc_service: watchdog 617:notify_rc start_ddns
Mar 17 18:56:31 custom_script: Running /jffs/scripts/ddns-start (args: xxx.xxx.xxx.xxx)
Mar 17 18:56:33 ddns: Custom ddns update failed
Last edited: