updated nic_duckdns_update to account for extra lines in duckdns reply
This commit is contained in:
parent
e910204b3d
commit
d35d62f3e7
1 changed files with 21 additions and 9 deletions
20
ddclient.in
20
ddclient.in
|
@ -6559,17 +6559,29 @@ sub nic_duckdns_update {
|
|||
next if !header_ok($h, $reply);
|
||||
|
||||
my @reply = split /\n/, $reply;
|
||||
my $returned = pop(@reply);
|
||||
if ($returned =~ /OK/) {
|
||||
my $state = 'noresult';
|
||||
my $line = '';
|
||||
|
||||
foreach $line (@reply) {
|
||||
if ($line eq 'OK') {
|
||||
$config{$h}{'ip'} = $ip;
|
||||
$config{$h}{'mtime'} = $now;
|
||||
$config{$h}{'status'} = 'good';
|
||||
$state = 'result';
|
||||
success("updating %s: good: IP address set to %s", $h, $ip);
|
||||
} else {
|
||||
|
||||
} elsif ($line eq 'KO') {
|
||||
$config{$h}{'status'} = 'failed';
|
||||
failed("updating %s: Server said: '%s'", $h, $returned);
|
||||
$state = 'result';
|
||||
failed("updating %s: Server said: '%s'", $h, $line);
|
||||
}
|
||||
}
|
||||
|
||||
if ($state eq 'noresult') {
|
||||
failed("updating %s: Server said: '%s'", $h, $line);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
|
|
Loading…
Reference in a new issue