How to replace the buggy Inadyn / DDNS (bash script and cron

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Ralink SoC based Hardware
Author Message
Specimen
DD-WRT User


Joined: 22 Mar 2013
Posts: 55

PostPosted: Wed Jul 15, 2015 13:33    Post subject: How to replace the buggy Inadyn / DDNS (bash script and cron Reply with quote
The current version of Inadyn in dd-wrt is 1.96, which is 10 years old, recently I noticed it causes a zombie process each time it updates my DNSOMATIC account.

I created this ticket: http://svn.dd-wrt.com/ticket/4743

But I really don't think it's going to be fixed and I have a less resource consuming solution in the mean time.

Which is this script that is run by cron every 10 minutes, you can completely disable inadyn (DDNS in the web GUI) and use this instead.

Code:
#!/bin/sh

MYIP=$(wget -qT 20 -O - "http://myip.dnsomatic.com")
LOGFILE="/tmp/myddns.log"

test -f $LOGFILE || touch $LOGFILE

GETLOGIP=$(cat $LOGFILE)

if [ -n "$MYIP" -a "$GETLOGIP" != "$MYIP" ]; then
    if wget -qT 20 [INSERT WGET SYNTAX RELEVANT TO YOUR DDNS SERVICE HERE] > /dev/null 2>&1 ; then
        echo $MYIP > $LOGFILE
        logger myddns.sh: IP updated to $MYIP
    fi
fi


You can easily find on the internet the relevant wget or curl syntaxes for your DDNS service. If you can install curl you can also have SSL support.

Here are some examples of wget for different services: ​http://www.techrapid.co.uk/linux/updating-dynamic-dns-ddns-with-wget-on-linux/

I used dnsomatic for the external IP check, but you can use any other IP check service, you can see by the code that it doesn't matter what the site spurts out besides the IP, the code just compares if the reply it get is different from the last logged one.

You can add multiple services if that's your thing too, and not be limited just to one as you are with the WebGUI.

You need a basic knowledge of bash and cron to do this, so, if you are not familiar with those I'm not going to do any sort of hand-holding, you are on your own, this script is provided AS IS.

Sayonara to Inadyn


Last edited by Specimen on Wed Jul 15, 2015 14:10; edited 1 time in total
Sponsor
KrypteX
DD-WRT Guru


Joined: 18 Jan 2014
Posts: 1513

PostPosted: Wed Jul 15, 2015 14:06    Post subject: Reply with quote
I've reopened ticket http://svn.dd-wrt.com/ticket/3551
An update to Inadyn would be awesome.

_________________
THERE ARE NO STRANGERS HERE; ONLY FRIENDS YOU HAVEN'T YET MET.
______________________________________
DD-WRT Links: BUILDS / TRAC / CHANGELOG

Atheros:
Netgear WNDR3800 ...... DD-WRT 27456 - K3.10.81
Netgear WNR2200 ........ DD-WRT 27378
Netgear WNR2000v3 ..... DD-WRT 27456
TP-Link WR710Nv1 ....... DD-WRT 27456 - K3.10.81
TP-Link WR740Nv4 ....... DD-WRT 23720
Broadcom:
Linksys E3000 .............. DD-WRT 27240
Ralink:
D-Link DIR-615 D2 ....... DD-WRT 27490 - K3.2.69
Specimen
DD-WRT User


Joined: 22 Mar 2013
Posts: 55

PostPosted: Wed Jul 15, 2015 14:13    Post subject: Reply with quote
KrypteX wrote:
I've reopened ticket http://svn.dd-wrt.com/ticket/3551
An update to Inadyn would be awesome.


That would be great, but even if they don't update it they should look at this zombie process bug.

Using this script, however, is much more resource friendly, inadyn runs as a background process, although it checks only every 10 minutes, this is just a script that runs at a given frequency (10 minutes, for instance).
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Ralink SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum