Fix false success reporting on failure
Add example url
This commit is contained in:
parent
7f98a24fed
commit
42a515ad71
1 changed files with 5 additions and 3 deletions
8
ddclient
8
ddclient
|
@ -4071,6 +4071,8 @@ EoEXAMPLE
|
||||||
######################################################################
|
######################################################################
|
||||||
## nic_duckdns_update
|
## nic_duckdns_update
|
||||||
## by George Kranis (copypasta from nic_dtdns_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 {
|
sub nic_duckdns_update {
|
||||||
debug("\nnic_duckdns_update -------------------");
|
debug("\nnic_duckdns_update -------------------");
|
||||||
|
@ -4103,7 +4105,9 @@ sub nic_duckdns_update {
|
||||||
}
|
}
|
||||||
last if !header_ok($h, $reply);
|
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}{'ip'} = $ip;
|
||||||
$config{$h}{'mtime'} = $now;
|
$config{$h}{'mtime'} = $now;
|
||||||
|
@ -4112,8 +4116,6 @@ sub nic_duckdns_update {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my @reply = split /\n/, $reply;
|
|
||||||
my $returned = pop(@reply);
|
|
||||||
$config{$h}{'status'} = 'failed';
|
$config{$h}{'status'} = 'failed';
|
||||||
failed("updating %s: Server said: '$returned'", $h);
|
failed("updating %s: Server said: '$returned'", $h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue