What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Custom DDNS script status

BartmanEH

New Around Here
I'm using the Merlin Wiki script for DDNS for Cloudflare. It works from terminal in Merlin but how do I know it's working autonomously? The built-in DDNS services have "Registration Successful" message in the DDNS GUI webpage but I don't see any status for Custom script even though its posting "/sbin/ddns_custom_updated 1"
 
Does your syslog contain an entry for ddns “Completed custom ddns update” or “Custom ddns update failed”? Those messages appear by running the ddns_custom_updated command.
 
I'm a bit of a hack with command line but with some AI help, I executed "grep "custom ddns update" /tmp/syslog.log" which returned no results.
 
Let’s see the output of these commands:
Code:
ls -l /jffs/scripts/ddns-start
nvram get jffs2_scripts
cat /jffs/scripts/ddns-start
/sbin/ddns_custom_updated 0
grep ddns /jffs/syslog.log
 
ls -l /jffs/scripts/ddns-start
-rwxrwxrwx 1 admin root 928 Feb 23 18:25 /jffs/scripts/ddns-start

nvram get jffs2_scripts
1

cat /jffs/scripts/ddns-start
#!/bin/sh
ZONEID=<redacted>
RECORDID=<redacted>
RECORDNAME=<redacted>
API=<redacted>
IP=${1}
LOGFILE=/jffs/scripts/ddns-update.log
DATE=$(date +"%Y-%m-%d %T")
if [ -z "$IP" ]; then
echo "$DATE: Error: No IP address parameter provided." >> "$LOGFILE"
echo "Error: No IP address parameter provided."
exit 1 # Exit with an error code
fi
curl -fs -o /dev/null -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID" \
-H "Authorization: Bearer $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
echo "$DATE: Cloudflare update successful. IP: $IP" >> $LOGFILE
else
/sbin/ddns_custom_updated 0
echo "$DATE: Cloudflare update failed. IP: $IP" >> $LOGFILE
fi

/sbin/ddns_custom_updated 0
(no output)

grep ddns /jffs/syslog.log
(no output)
 
Have you modified the System Log settings on the router?
 
not that I'm aware of. I installed Asuswrt-Merlin only a few days ago specifically for custom DDNS feature and that's all I've played with
EDIT: isn't syslog in /tmp/?
EDIT2:
grep "ddns" /tmp/syslog.log
Feb 27 09:53:35 ddns: Custom ddns update failed
 
Code:
/jffs/scripts/ddns-start <public ip redacted>
admin@RT-AX88U:/tmp/home/root# cat /jffs/scripts/ddns-update.log
2025-02-23 18:06:00: Cloudflare update failed. IP:                    <forgot to provide IP parameter>
2025-02-23 18:07:18: Cloudflare update successful. IP:                <public ip redacted>
2025-02-23 18:13:52: Cloudflare update successful. IP: 8.8.8.8        <tested using dummy IP>
2025-02-23 18:14:17: Cloudflare update successful. IP:                <public ip redacted>
2025-02-23 18:25:16: Error: No IP address parameter provided.         <tested new script with IP parameter check>
2025-02-27 10:12:28: Cloudflare update successful. IP:                <public ip redacted>
admin@RT-AX88U:/tmp/home/root# grep "ddns" /tmp/syslog.log
Feb 27 09:53:35 ddns: Custom ddns update failed
Feb 27 10:12:29 ddns: Completed custom ddns update
 
Last edited:
sometimes when I checkout the DDNS webpage, I see update status:
Screenshot 2025-02-27 at 10.46.32 AM.png


then I refresh the page and it's gone:
Screenshot 2025-02-27 at 10.46.39 AM.png
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top