nic_updateable: Simplify option changed detection logic
This commit is contained in:
parent
38a4e9eeef
commit
89d7193f69
1 changed files with 4 additions and 9 deletions
13
ddclient.in
13
ddclient.in
|
@ -3709,15 +3709,10 @@ sub nic_updateable {
|
||||||
|
|
||||||
} elsif (defined($force_update) && $force_update->($host)) {
|
} elsif (defined($force_update) && $force_update->($host)) {
|
||||||
$update = 1;
|
$update = 1;
|
||||||
} elsif ((defined($recap{$host}{'static'}) && defined($config{$host}{'static'}) &&
|
} elsif (my @changed = grep({ my $rv = $recap{$host}{$_}; my $cv = $config{$host}{$_};
|
||||||
($recap{$host}{'static'} ne $config{$host}{'static'})) ||
|
defined($rv) && defined($cv) && $rv ne $cv; }
|
||||||
(defined($recap{$host}{'wildcard'}) && defined($config{$host}{'wildcard'}) &&
|
qw(static wildcard mx backupmx))) {
|
||||||
($recap{$host}{'wildcard'} ne $config{$host}{'wildcard'})) ||
|
info("$host: update forced because options changed: " . join(', ', @changed));
|
||||||
(defined($recap{$host}{'mx'}) && defined($config{$host}{'mx'}) &&
|
|
||||||
($recap{$host}{'mx'} ne $config{$host}{'mx'})) ||
|
|
||||||
(defined($recap{$host}{'backupmx'}) && defined($config{$host}{'backupmx'}) &&
|
|
||||||
($recap{$host}{'backupmx'} ne $config{$host}{'backupmx'}))) {
|
|
||||||
info("updating %s because host settings have been changed.", $host);
|
|
||||||
$update = 1;
|
$update = 1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue