From 0f7b76630d1c5e065fa94bf47b06a237d84b983d Mon Sep 17 00:00:00 2001 From: George Kranis Date: Sun, 27 Apr 2014 00:44:44 +0300 Subject: [PATCH 1/4] Added Duck DNS --- ddclient | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/ddclient b/ddclient index 8c2d527..a8e8bd4 100755 --- a/ddclient +++ b/ddclient @@ -448,6 +448,10 @@ my %variables = ( 'mx' => setv(T_OFQDN, 0, 1, 1, '', undef), 'backupmx' => setv(T_BOOL, 0, 1, 1, 0, undef), }, + 'duckdns-common-defaults' => { + 'server' => setv(T_FQDNP, 1, 0, 1, 'www.duckdns.org', undef), + 'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef), + }, ); my %services = ( 'dyndns1' => { @@ -613,6 +617,15 @@ my %services = ( $variables{'service-common-defaults'}, ), }, + 'duckdns' => { + 'updateable' => undef, + 'update' => \&nic_duckdns_update, + 'examples' => \&nic_duckdns_examples, + 'variables' => merge( + $variables{'duckdns-common-defaults'}, + $variables{'service-common-defaults'}, + ), + }, ); $variables{'merged'} = merge($variables{'global-defaults'}, $variables{'service-common-defaults'}, @@ -4030,6 +4043,83 @@ sub nic_cloudflare_update { } } +###################################################################### +## nic_duckdns_examples +###################################################################### +sub nic_duckdns_examples { + return < Date: Sun, 27 Apr 2014 02:12:44 +0300 Subject: [PATCH 2/4] Duck dns documentation --- ddclient | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ddclient b/ddclient index a8e8bd4..d05cf8d 100755 --- a/ddclient +++ b/ddclient @@ -4050,8 +4050,7 @@ sub nic_duckdns_examples { return < Date: Sun, 2 Nov 2014 05:16:40 +0200 Subject: [PATCH 3/4] Fix false success reporting on failure Add example url --- ddclient | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ddclient b/ddclient index d05cf8d..a6282b9 100755 --- a/ddclient +++ b/ddclient @@ -4071,6 +4071,8 @@ EoEXAMPLE ###################################################################### ## nic_duckdns_update ## by George Kranis (copypasta from nic_dtdns_update) +## http://www.duckdns.org/update?domains=mydomain1,mydomain2&token=xxxx-xxx-xx-x&ip=x.x.x.x +## response contains OK or KO ###################################################################### sub nic_duckdns_update { debug("\nnic_duckdns_update -------------------"); @@ -4103,7 +4105,9 @@ sub nic_duckdns_update { } last if !header_ok($h, $reply); - if ($reply =~ /OK/) + my @reply = split /\n/, $reply; + my $returned = pop(@reply); + if ($returned =~ /OK/) { $config{$h}{'ip'} = $ip; $config{$h}{'mtime'} = $now; @@ -4112,8 +4116,6 @@ sub nic_duckdns_update { } else { - my @reply = split /\n/, $reply; - my $returned = pop(@reply); $config{$h}{'status'} = 'failed'; failed("updating %s: Server said: '$returned'", $h); } From cbe8151a4ed19b0ffc013b18fa6d5cb02792febb Mon Sep 17 00:00:00 2001 From: George Kranis Date: Sun, 2 Nov 2014 05:20:58 +0200 Subject: [PATCH 4/4] Added DuckDNS API url --- ddclient | 1 + 1 file changed, 1 insertion(+) diff --git a/ddclient b/ddclient index a6282b9..978458c 100755 --- a/ddclient +++ b/ddclient @@ -4052,6 +4052,7 @@ o 'duckdns' The 'duckdns' protocol is used by the free dynamic DNS service offered by www.duckdns.org. +Check http://www.duckdns.org/install.jsp?tab=linux-cron for API Configuration variables applicable to the 'duckdns' protocol are: protocol=duckdns ##