added latest version of ddclient, including my patch for everydns.net-support

This commit is contained in:
Manuel Friedli 2007-12-17 23:43:37 +00:00
commit 40108876ec
12 changed files with 393 additions and 0 deletions

View file

@ -0,0 +1,15 @@
--- ddclient.orig 2005-01-16 15:18:36.485003496 -0500
+++ ddclient 2005-01-16 15:19:15.628052848 -0500
@@ -924,6 +924,12 @@
my $def = $variables{'merged'}{$k};
my $ovalue = define($globals{$k}, $def->{'default'});
my $value = check_value($ovalue, $def);
+
+ # we should really be allowed to set daemon to 0 in the config file
+ if ($k eq 'daemon' && $ovalue == 0) {
+ $value = $ovalue;
+ }
+
if ($def->{'required'} && !defined $value) {
$value = default($k);
warning("'%s=%s' is an invalid %s. (using default of %s)", $k, $ovalue, $def->{'type'}, $value);

View file

@ -0,0 +1,96 @@
Index: ddclient
===================================================================
--- ddclient (Revision 52)
+++ ddclient (Arbeitskopie)
@@ -464,6 +464,16 @@
$variables{'service-common-defaults'},
),
},
+ 'everydns' => {
+ 'updateable' => undef,
+ 'update' => \&nic_everydns_update,
+ 'examples' => \&nic_everydns_examples,
+ 'variables' => merge(
+ { 'server' => setv(T_FQDNP, 1, 0, 1, 'dyn.everydns.net', undef) },
+ { 'min-interval' => setv(T_DELAY, 0, 0, 1, 0, interval('15m')) },
+ $variables{'service-common-defaults'},
+ ),
+ },
);
$variables{'merged'} = merge($variables{'global-defaults'},
$variables{'service-common-defaults'},
@@ -3122,8 +3132,74 @@
}
}
}
+######################################################################
+## nic_everydns_examples
+######################################################################
+sub nic_everydns_examples {
+ return <<EoEXAMPLE;
+o 'everydns'
+The 'everydns' protocol is the protocol used by the free dynamic
+DNS service offered by EveryDNS at www.everydns.net. So far it actually ignores the
+value of the domain, it just updates all domains associated with the account
+that belongs to the given credentials
+
+Configuration variables applicable to the 'everydns' protocol are:
+ protocol=everydns ##
+ server=dyn.everydns.net ## defaults to members.dyndns.org
+ login=service-login ## login name and password registered with the service
+ password=service-password ##
+ domain.name ## the domain registered with the service.
+
+Example ${program}.conf file entries:
+ ## single host update
+ protocol=everydns, \\
+ login=my-everydns.net-login, \\
+ password=my-everydns.net-password \\
+ my-example-domain.com
+
+EoEXAMPLE
+}
######################################################################
+## nic_everydns_update
+######################################################################
+sub nic_everydns_update {
+ debug("\nnic_everydns_update -------------------");
+
+ ## update each configured domain
+ foreach my $d (@_) {
+ info("setting IP address to %s for %s", $ip, $d);
+ verbose("UPDATE:","updating %s", $d);
+
+ my $url;
+ $url = "http://$config{$d}{'server'}/index.php";
+ $url .= "?ver=0.1";
+ $url .= "&ip=$ip" if $ip;
+ # $url .= "&domain=$d" if $d;
+
+ my $reply = geturl(opt('proxy'), $url, $config{$d}{'login'}, $config{$d}{'password'});
+ if (!defined($reply) || !$reply) {
+ failed("updating %s: Could not connect to %s.", $d, $config{$d}{'server'});
+ last;
+ }
+ last if !header_ok($d, $reply);
+
+ my @reply = split /\n/, $reply;
+ if (grep /^Exit Code: 0$/i, @reply) {
+ $config{$d}{'ip'} = $ip;
+ $config{$d}{'mtime'} = $now;
+ $config{$d}{'status'} = 'good';
+ success("updating %s: good: IP address set to %s", $d, $ip);
+ } else {
+ $config{$d}{'status'} = 'failed';
+ warning("SENT: %s", $url) unless opt('verbose');
+ warning("REPLIED: %s", $reply);
+ failed("updating %s: Invalid reply.", $d);
+ }
+ }
+}
+
+######################################################################
# vim: ai ts=4 sw=4 tw=78 :

View file

@ -0,0 +1,11 @@
--- ddclient.bak 2003-11-05 10:42:33.000000000 +1000
+++ ddclient 2003-11-05 10:52:55.000000000 +1000
@@ -20,7 +20,7 @@
$program =~ s/d$//;
my $now = time;
my $hostname = hostname();
-my $etc = ($program =~ /test/i) ? './' : '/etc/';
+my $etc = ($program =~ /test/i) ? './' : '/etc/ddclient/';
my $savedir = ($program =~ /test/i) ? 'URL/' : '/tmp/';
my $msgs = '';
my $last_msgs = '';

View file

@ -0,0 +1,11 @@
--- ddclient.bak 2003-11-05 10:42:33.000000000 +1000
+++ ddclient 2003-11-05 10:48:12.000000000 +1000
@@ -2629,7 +2629,7 @@
my $h = pop @hosts;
$config{$h}{'status'} = $status;
- if ($status eq 'ok') {
+ if ($status eq 'ok' || $status eq 'nochange') {
$config{$h}{'ip'} = $ip;
$config{$h}{'mtime'} = $now;
success("updating %s: %s: IP address set to %s", $h, $status, $ip);

View file

@ -0,0 +1,21 @@
--- ddclient 2006-04-11 10:14:16.000000000 +0100
+++ ddclient 2006-04-11 20:31:14.000000000 +0100
@@ -776,15 +776,10 @@
# fatal("Cannot open file '%s'. ($!)", $file);
warning("Cannot open file '%s'. ($!)", $file);
}
- # Check for only owner has any access to config file
+ # Guard against world-readability of config file
my ($dev, $ino, $mode, @statrest) = stat(FD);
- if ($mode & 077) {
- if (-f FD && (chmod 0600, $file)) {
- warning("file $file must be accessible only by its owner (fixed).");
- } else {
- # fatal("file $file must be accessible only by its owner.");
- warning("file $file must be accessible only by its owner.");
- }
+ if ($mode & 007) {
+ fatal("Must not be world-accessible\nchange its permissions using e.g.\nchmod 640", $file);
}
local $lineno = 0;

View file

@ -0,0 +1,2 @@
# No need to specify a pid in /etc/ddclient/ddclient.conf
PIDFILE=/var/run/ddclient/ddclient.pid

View file

@ -0,0 +1,30 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.init,v 1.1 2005/04/01 22:20:38 seemant Exp $
depend() {
need net
}
checkconfig() {
if [ ! -e /etc/ddclient/ddclient.conf ] ; then
eerror "You need a /etc/ddclient/ddclient.conf file to run ddclient"
eerror "There is a sample file in /etc/ddclient/"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting DDClient"
start-stop-daemon --start --chuid ddclient --quiet --exec /usr/sbin/ddclient 2&>/dev/null
eend $?
}
stop() {
ebegin "Stopping DDClient"
start-stop-daemon --stop --quiet --name ddclient
eend $?
}

View file

@ -0,0 +1,52 @@
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.initd,v 1.2 2007/08/08 03:17:32 uberlord Exp $
# Default location if not specified in /etc/conf.d/ddclient
PIDFILE=${PIDFILE:-/var/run/ddclient/ddclient.pid}
depend() {
before cron
need net
use dns logger
}
checkconfig() {
local conf="/etc/ddclient/ddclient.conf"
if [ -e "${conf}" ] ; then
if [ -n "$(find /etc/ddclient -maxdepth 1 -name ddclient.conf -perm +0004)" ] ; then
eerror "${conf} must not be world-readable. Run e.g.:"
eerror " chmod 640 ${conf}"
eerror " chown root:ddclient ${conf}"
return 1
fi
else
eerror "/etc/ddclient/ddclient.conf is needed to run ddclient"
eerror "There is a sample file in /etc/ddclient/"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting ${SVCNAME}"
start-stop-daemon \
--start \
--chuid ddclient \
--exec /usr/sbin/ddclient \
--name ddclient \
--pidfile "${PIDFILE}" \
-- -pid="${PIDFILE}"
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon \
--stop \
--signal USR1 \
--pidfile "${PIDFILE}"
eend $?
}

View file

@ -0,0 +1,30 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.rc6,v 1.4 2004/07/14 23:21:59 agriffis Exp $
depend() {
need net
}
checkconfig() {
if [ ! -e /etc/ddclient/ddclient.conf ] ; then
eerror "You need a /etc/ddclient/ddclient.conf file to run ddclient"
eerror "There is a sample file in /etc/ddclient/"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting DDClient"
start-stop-daemon --start --quiet --exec /usr/sbin/ddclient
eend $?
}
stop() {
ebegin "Stopping DDClient"
start-stop-daemon --stop --quiet --pidfile /var/run/ddclient.pid
eend $?
}

View file

@ -0,0 +1,3 @@
MD5 5459ae165e74437587b6e84225a7fbf0 ddclient-3.7.3.tar.gz 42034
RMD160 df40a809132102b9326fa7e9d735723e1de8ed37 ddclient-3.7.3.tar.gz 42034
SHA256 f1f57fdca170d9349cb99a3b8b33672d983e0e41c43c2bbb940927380ee12962 ddclient-3.7.3.tar.gz 42034