What's new

ddns by script

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

steelskinz

Regular Contributor
Hi there,
i tried to run manually ddns-start but i always got this error :
ddns-start: line 23: syntax error: unexpected end of file (expecting "then")

Line 23 is the last one and is empty.

I used the script provided here https://github.com/RMerl/asuswrt-merlin/wiki/DDNS-Sample-Scripts#dns-o-matic and also tried with @ instead of %40. Same result :(
#!/bin/sh
#DNS-O-Matic
USERNAME=XXX%40XXX.XXX
PASSWORD=XXXXXXXX
HOSTNAME=all.dnsomatic.com
# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent "https://$USERNAME:$PASSWORD@updates...ME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" > /dev/null
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi

Other error if i try duckdns script :
#!/bin/sh
#DuckDNS
SUBDOMAIN="xxxxxx"
TOKEN="xxxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"
curl --silent "https://www.duckdns.org/update?domains=$SUBDOMAIN&token=$TOKEN&ip=" >/dev/null 2>&1
if [ $? -eq 0 ];
then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
ddns-start: line 5: redir error
Line 5 is curl --silent etc...

Was anyone in the same situation ? Thanks.
 
Last edited:
I added it with notepad++
not working with sh -x. I'll try your script. It is working with dns o matic ? and duckdns too ? (there's no need to have password just token) I read it's for no-ip. Thanks !
 
Code:
dos2unix /jffs/scripts/ddns-start
 

Similar threads

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