What's new

deSEC DDNS update 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!

Markfree

Regular Contributor
After failing to create a custom Inadyn DDNS configuration for deSEC.io that would update both IPv4 and IPv6, I've created a script that updates my deSEC domain IP.
It is a simple yet effective script that updates a deSEC.io domain name with the latest WAN IPv4 and IPv6 addresses. It uses deSEC's API to push updates.

If anyone wants to try it out, it is available on Github.

First, add the script to your /jffs partition.
wget -qO /jffs/scripts/desec_ddns.sh https://diasdmhub.github.io/scripts/mt_desec_ddns/desec_ddns.sh


Second, edit the script, look at its header and change the deSEC values in to match your own configuration.
# nano /jffs/scripts/desec_ddns.sh
Bash:
# deSEC domain
desecDomain="## YOUR DOMAIN NAME ##"

# deSEC DNS Token
desecToken="## DESEC TOKEN ##"

# WAN interface name
wanInterface="## YOUR WAN INTERFACE ##"


Third, add a schedule for it. I used init-start and appended a crontab directive.
# nano /jffs/scripts/init-start
# deSEC DDNS update script scheduled for every 30 minutes
cru a deSEC_DDNS "*/30 * * * * /jffs/scripts/desec_ddns.sh"

It was created for personal use, but may be useful for someone else as well.
Cheers
 
Last edited:
It looks like a scheduled task, shouldn't it be inside the cond job ? "ini_ start" seems to be used for starting the project on boot,Although my scheduled task is currently not working.
 
Will have a look at this tonight! It did make me notice that my WAN IP addresses (4 & 6) changed at 2am last night, no reboot - thanks BT!
It's certainly neater than my script for DynV6, and I do worry that DynV6 seem to provide the service in return for absolutely nothing. Always makes me fearfully the service may just stop one day - though I have no good reason to believe it will
 
It looks like a scheduled task, shouldn't it be inside the cond job ? "ini_ start" seems to be used for starting the project on boot,Although my scheduled task is currently not working.
Indeed, it may not be the best user script to add a cron task.
I think I got it from this Merlin's wiki. init-start works for me, but you could probably use something else like services-start, nat-start or ddns-start.
 
Indeed, it may not be the best user script to add a cron task.
I think I got it from this Merlin's wiki. init-start works for me, but you could probably use something else like services-start, nat-start or ddns-start.
I tried the method you mentioned but failed. Fortunately, cron is now running . When I installed amtm
 

Similar threads

Sign Up For SNBForums Daily Digest

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