2 # set list of bad dx nodes
4 # Copyright (c) 2021 - Dirk Koopman G1TLH
8 my ($self, $line) = @_;
9 return (1, $self->msg('e5')) if $self->remotecmd;
11 return (1, $self->msg('e5')) if $self->priv < 6;
12 return (1, q{Please install Net::CIDR::Lite or libnet-cidr-lite-perl to use this command}) unless $DXCIDR::active;
16 my @in = split /\s+/, $line;
18 my $width = $self->width // 80;
23 my @list = map {my $s = $_; $s =~ s|/32$||; $maxlth = length $s if length $s > $maxlth; $s =~ /^1$/?undef:$s} DXCIDR::list();
26 my $n = int ($width/($maxlth+1));
27 my $format = "\%-${maxlth}s " x $n;
30 foreach my $list (@list) {
40 push @out, sprintf $format, @l;
47 push @l, "" while @l < $n;
48 push @out, sprintf $format, @l;
51 push @out, "show/badip: " . scalar @out . " records found";