What's new

DDNS failure when restarting WAN

  • 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!

sbsnb

Very Senior Member
My custom DDNS works fine for years except today when I manually stopped and started the WAN. My DDNS script performs two actions: updates afraid.org via wget and sends me an email with the new IP. I received two emails with the new IP after manually restarting the WAN, but afraid.org was not updated as verified by manually logging in to the account on afraid.org. Manually running the wget command updated the IP as expected.
 
Log
Code:
Sep 15 09:57:36 rc_service: httpd 494:notify_rc restart_wan_if 0
Sep 15 09:57:36 custom_script: Running /jffs/scripts/service-event (args: restart wan_if)
Sep 15 09:57:53 start_ddns: update CUSTOM , wan_unit 0
Sep 15 09:57:53 custom_script: Running /jffs/scripts/ddns-start (args: 47.149.x.x)
Sep 15 09:58:01 watchdog: start ddns.
Sep 15 09:58:01 rc_service: watchdog 498:notify_rc start_ddns
Sep 15 09:58:01 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Sep 15 09:58:01 start_ddns: update CUSTOM , wan_unit 0
Sep 15 09:58:02 custom_script: Running /jffs/scripts/ddns-start (args: 47.149.x.x)
Sep 15 09:58:18 ddns: Completed custom ddns update
Sep 15 09:58:18 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Sep 15 09:58:20 ddns: Completed custom ddns update
 
Don`t forget to also flag the DDNS as updated, as per the Wiki documentation.
 
It is. This is my script:

Code:
#!/bin/sh

API="xxxxxxxxxxxxxxxxxxx"
# Your afraid.org API Key

curl -fs -o /dev/null "https://freedns.afraid.org/dynamic/update.php?${API}"
curl -fs -o /dev/null "http://www.foo.com/ipmail.php"

if [ $? -eq 0 ]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
 
It is. This is my script:

Code:
#!/bin/sh

API="xxxxxxxxxxxxxxxxxxx"
# Your afraid.org API Key

curl -fs -o /dev/null "https://freedns.afraid.org/dynamic/update.php?${API}"
curl -fs -o /dev/null "http://www.foo.com/ipmail.php"

if [ $? -eq 0 ]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
Your script is testing the success of the email curl and not the afraid.org curl command. It may be failing, but you tell the router it was successful as long as your email was sent.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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