Merge 44f96cb1a9 into 228efa7927
This commit is contained in:
commit
2410c2af36
1 changed files with 38 additions and 31 deletions
11
ddclient.in
11
ddclient.in
|
|
@ -5997,10 +5997,16 @@ sub nic_hetzner_update {
|
|||
next;
|
||||
}
|
||||
# Pull the ID out of the json, messy
|
||||
my ($dns_rec_id) = map { ($_->{name} eq $hostname && $_->{type} eq $type) ? $_->{id} : ()} @{$response->{records}};
|
||||
my ($dns_rec_id, $current_ip) = map { ($_->{name} eq $hostname && $_->{type} eq $type) ? ($_->{id}, $_ ->{value}) : ()} @{$response->{records}};
|
||||
|
||||
# Set domain
|
||||
my $http_method="";
|
||||
if ($current_ip && $current_ip eq $ip) {
|
||||
info("updating %s %s: IP is already %s, no update needed.", $hostname, $ipv, $ip);
|
||||
$config{$domain}{"ipv$ipv"} = $ip;
|
||||
$config{$domain}{'mtime'} = $now;
|
||||
$config{$domain}{"status-ipv$ipv"} = 'good';
|
||||
} else {
|
||||
# Set domain
|
||||
if ($dns_rec_id)
|
||||
{
|
||||
debug("updating %s: DNS '$type' record ID: $dns_rec_id", $domain);
|
||||
|
|
@ -6036,6 +6042,7 @@ sub nic_hetzner_update {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
|
|
|
|||
Loading…
Reference in a new issue