[Ddclient-support] Avoiding update when the IP has not changed
Brought to you by:
supersandro2000,
wimpunk
From: Roberto P. <ik...@gm...> - 2014-05-06 20:49:09
|
Hi all, I have seen on the syslog that ddclient write a warning WARNING: updating .... nochg: No update required; unnecessary attempts to change to the current address are considered abusive So checking the code (from my little understanding) it seems that the update procedure will happen also when the IP hasn't changed. I have then added a little piece of code (just for the no-ip section but similar can be done on dyndns section) This little piece of code check the ip for the host to be updated against the one obtained by Google dns server. If the wanted ip address is same of the one obtained from google DNS server 8.8.8.8 then a "SUCCESS" message will be printed and remain part of the code will be skipped for that host. Here my diff of original client and my mod I don't know if this feature is already present on the code and was just me that didn't realyze that. If not, i hope someone will do similar change on the mainained code adding same also on dyndns part. Cheers Roberto ========================================= diff /usr/sbin/ddclient.orig /usr/sbin/ddclient 2465a2466,2473 > my $host_ip = `host $h 8.8.8.8|grep $h|sed 's/.*has address //'`; > > if ( $ip == $host_ip ) > { > success("Host already updated %s: IP address is %s was %s", $h, $ip, $host_ip); > } > else > { 2537a2546 > } |