This commit is contained in:
philippderdiedas 2024-07-27 12:52:28 +01:00 committed by GitHub
commit 2410c2af36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {
}
}
}
}
}
######################################################################