Delete unnecessary nic_dyndns2_force_update

The `nic_updateable` function already checks the variables to see if
they have changed, so this function is redundant.
This commit is contained in:
Richard Hansen 2024-06-16 17:13:54 -04:00
parent 2a9abc9d4c
commit 5a8bee1e4d

View file

@ -836,7 +836,7 @@ our %protocols = (
}, },
}, },
'dyndns1' => { 'dyndns1' => {
'force_update' => \&nic_dyndns2_force_update, 'force_update' => undef,
'update' => \&nic_dyndns1_update, 'update' => \&nic_dyndns1_update,
'examples' => \&nic_dyndns1_examples, 'examples' => \&nic_dyndns1_examples,
'variables' => { 'variables' => {
@ -846,7 +846,7 @@ our %protocols = (
}, },
}, },
'dyndns2' => { 'dyndns2' => {
'force_update' => \&nic_dyndns2_force_update, 'force_update' => undef,
'update' => \&nic_dyndns2_update, 'update' => \&nic_dyndns2_update,
'examples' => \&nic_dyndns2_examples, 'examples' => \&nic_dyndns2_examples,
'variables' => { 'variables' => {
@ -3932,29 +3932,7 @@ sub nic_dyndns1_update {
} }
} }
} }
######################################################################
## nic_dyndns2_force_update
######################################################################
sub nic_dyndns2_force_update {
my $host = shift;
my $update = 0;
if ($config{$host}{'mx'} ne $recap{$host}{'mx'}) {
info("forcing updating %s because 'mx' has changed to %s.", $host, $config{$host}{'mx'});
$update = 1;
} elsif ($config{$host}{'mx'} && (ynu($config{$host}{'backupmx'}, 1, 2, 3) ne ynu($recap{$host}{'backupmx'}, 1, 2, 3))) {
info("forcing updating %s because 'backupmx' has changed to %s.", $host, ynu($config{$host}{'backupmx'}, "YES", "NO", "NO"));
$update = 1;
} elsif ($config{$host}{'static'} ne $recap{$host}{'static'}) {
info("forcing updating %s because 'static' has changed to %s.", $host, ynu($config{$host}{'static'}, "YES", "NO", "NO"));
$update = 1;
}
return $update;
}
###################################################################### ######################################################################
## nic_dyndns2_examples ## nic_dyndns2_examples
###################################################################### ######################################################################