dyndns2: Wrap long list of group by attributes

This commit is contained in:
Richard Hansen 2024-07-13 04:52:05 -04:00
parent 203bf12245
commit d489cea344

View file

@ -4013,7 +4013,6 @@ EoEXAMPLE
######################################################################
sub nic_dyndns2_update {
debug("\nnic_dyndns2_update -------------------");
my @groups = group_hosts_by(\@_, qw(login password server script static custom wildcard mx backupmx wantipv4 wantipv6));
my %errors = (
'badauth' => 'Bad authorization (username or password)',
'badsys' => 'The system parameter given was not valid',
@ -4027,7 +4026,20 @@ sub nic_dyndns2_update {
'dnserr' => 'System error: DNS error encountered. Contact support@dyndns.org',
'nochg' => 'No update required; unnecessary attempts to change to the current address are considered abusive',
);
for my $group (@groups) {
my @group_by_attrs = qw(
backupmx
custom
login
mx
password
script
server
static
wantipv4
wantipv6
wildcard
);
for my $group (group_hosts_by(\@_, @group_by_attrs)) {
my @hosts = @{$group->{hosts}};
my %groupcfg = %{$group->{cfg}};
my $hosts = join(',', @hosts);