easydns: Remove unnecessary single host groupings
This commit is contained in:
parent
c8ee25ef82
commit
217bc998fc
1 changed files with 9 additions and 16 deletions
25
ddclient.in
25
ddclient.in
|
@ -4771,30 +4771,24 @@ EoEXAMPLE
|
||||||
######################################################################
|
######################################################################
|
||||||
sub nic_easydns_update {
|
sub nic_easydns_update {
|
||||||
debug("\nnic_easydns_update -------------------");
|
debug("\nnic_easydns_update -------------------");
|
||||||
my %groups = map { $_ => [ $_ ] } @_;
|
|
||||||
my %errors = (
|
my %errors = (
|
||||||
'NOACCESS' => 'Authentication failed. This happens if the username/password OR host or domain are wrong.',
|
'NOACCESS' => 'Authentication failed. This happens if the username/password OR host or domain are wrong.',
|
||||||
'NOSERVICE' => 'Dynamic DNS is not turned on for this domain.',
|
'NOSERVICE' => 'Dynamic DNS is not turned on for this domain.',
|
||||||
'ILLEGAL' => 'Client sent data that is not allowed in a dynamic DNS update.',
|
'ILLEGAL' => 'Client sent data that is not allowed in a dynamic DNS update.',
|
||||||
'TOOSOON' => 'Update frequency is too short.',
|
'TOOSOON' => 'Update frequency is too short.',
|
||||||
);
|
);
|
||||||
for my $sig (keys %groups) {
|
for my $h (@_) {
|
||||||
my @hosts = @{$groups{$sig}};
|
my $ipv4 = delete $config{$h}{'wantipv4'};
|
||||||
my $hosts = join(',', @hosts);
|
my $ipv6 = delete $config{$h}{'wantipv6'};
|
||||||
my $h = $hosts[0];
|
|
||||||
my $ipv4 = $config{$h}{'wantipv4'};
|
|
||||||
my $ipv6 = $config{$h}{'wantipv6'};
|
|
||||||
delete $config{$_}{'wantipv4'} for @hosts;
|
|
||||||
delete $config{$_}{'wantipv6'} for @hosts;
|
|
||||||
|
|
||||||
info("setting IP address to %s %s for %s", $ipv4, $ipv6, $hosts);
|
info("setting IP address to %s %s for %s", $ipv4, $ipv6, $h);
|
||||||
verbose("UPDATE:", "updating %s", $hosts);
|
verbose("UPDATE:", "updating %s", $h);
|
||||||
|
|
||||||
#'https://api.cp.easydns.com/dyn/generic.php?hostname=test.burry.ca&myip=10.20.30.40&wildcard=ON'
|
#'https://api.cp.easydns.com/dyn/generic.php?hostname=test.burry.ca&myip=10.20.30.40&wildcard=ON'
|
||||||
|
|
||||||
my $url;
|
my $url;
|
||||||
$url = "https://$config{$h}{'server'}$config{$h}{'script'}?";
|
$url = "https://$config{$h}{'server'}$config{$h}{'script'}?";
|
||||||
$url .= "hostname=$hosts";
|
$url .= "hostname=$h";
|
||||||
$url .= "&myip=";
|
$url .= "&myip=";
|
||||||
$url .= $ipv4 if $ipv4;
|
$url .= $ipv4 if $ipv4;
|
||||||
for my $ipv6a ($ipv6) {
|
for my $ipv6a ($ipv6) {
|
||||||
|
@ -4815,10 +4809,10 @@ sub nic_easydns_update {
|
||||||
password => $config{$h}{'password'},
|
password => $config{$h}{'password'},
|
||||||
) // '';
|
) // '';
|
||||||
if ($reply eq '') {
|
if ($reply eq '') {
|
||||||
failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'});
|
failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'});
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
next if !header_ok($hosts, $reply);
|
next if !header_ok($h, $reply);
|
||||||
|
|
||||||
my @reply = split /\n/, $reply;
|
my @reply = split /\n/, $reply;
|
||||||
my $state = 'header';
|
my $state = 'header';
|
||||||
|
@ -4833,7 +4827,6 @@ sub nic_easydns_update {
|
||||||
$state = 'results2';
|
$state = 'results2';
|
||||||
|
|
||||||
my ($status) = $line =~ /^(\S*)\b.*/;
|
my ($status) = $line =~ /^(\S*)\b.*/;
|
||||||
my $h = shift @hosts;
|
|
||||||
|
|
||||||
$config{$h}{'status-ipv4'} = $status if $ipv4;
|
$config{$h}{'status-ipv4'} = $status if $ipv4;
|
||||||
$config{$h}{'status-ipv6'} = $status if $ipv6;
|
$config{$h}{'status-ipv6'} = $status if $ipv6;
|
||||||
|
@ -4863,7 +4856,7 @@ sub nic_easydns_update {
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'})
|
failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'})
|
||||||
if $state ne 'results2';
|
if $state ne 'results2';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue