Skip to content

Commit

Permalink
nic_updateable: Don't mutate status-ipv* vars if not updating
Browse files Browse the repository at this point in the history
This simplifies the logic a bit and improves readability.
  • Loading branch information
rhansen committed Sep 2, 2024
1 parent 25fac76 commit 75552f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ddclient.in
Original file line number Diff line number Diff line change
Expand Up @@ -3607,15 +3607,12 @@ sub nic_updateable {
}
}

delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6);
if ($update) {
$config{$host}{'update'} = 1;
$config{$host}{'atime'} = $now;
delete($config{$host}{$_}) for qw(wtime warned-min-interval warned-min-error-interval);
delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6 wtime
warned-min-interval warned-min-error-interval);
} else {
for (qw(status-ipv4 status-ipv6)) {
$config{$host}{$_} = $recap{$host}{$_} if defined($recap{$host}{$_});
}
delete($config{$host}{$_}) for qw(wantipv4 wantipv6);
}

Expand Down

0 comments on commit 75552f8

Please sign in to comment.