projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix is_ipaddr? change pc92 A/D default
[spider.git]
/
cmd
/
show
/
badip.pl
diff --git
a/cmd/show/badip.pl
b/cmd/show/badip.pl
index c7b2122d472a92927d30f8aa0a10e337d7fd77b9..55fa556b8e675384e9ccd75d24439721d0ddfd16 100644
(file)
--- a/
cmd/show/badip.pl
+++ b/
cmd/show/badip.pl
@@
-1,7
+1,7
@@
#
#
-# s
et
list of bad dx nodes
+# s
how (or find)
list of bad dx nodes
#
#
-# Copyright (c) 2021 - Dirk Koopman G1TLH
+# Copyright (c) 2021
-2023
- Dirk Koopman G1TLH
#
#
#
#
#
#
@@
-19,7
+19,6
@@
my $width = $self->width // 80;
#$DB::single = 1;
#$DB::single = 1;
-
my @list = map {my $s = $_; $s =~ s|/32$||; $maxlth = length $s if length $s > $maxlth; $s =~ /^1$/?undef:$s} DXCIDR::list();
my @l;
$maxlth //= 20;
my @list = map {my $s = $_; $s =~ s|/32$||; $maxlth = length $s if length $s > $maxlth; $s =~ /^1$/?undef:$s} DXCIDR::list();
my @l;
$maxlth //= 20;
@@
-27,15
+26,18
@@
my $n = int ($width/($maxlth+1));
my $format = "\%-${maxlth}s " x $n;
chop $format;
my $format = "\%-${maxlth}s " x $n;
chop $format;
+my $count = 0;
+
foreach my $list (@list) {
if (@in) {
foreach my $list (@list) {
if (@in) {
- for (@in) {
- if ($list =~ /$
_
/i) {
+ for
my $in
(@in) {
+ if ($list =~ /$
in
/i) {
push @out, $list;
push @out, $list;
-
las
t;
+
++$coun
t;
}
}
} else {
}
}
} else {
+ ++$count;
if (@l > $n) {
push @out, sprintf $format, @l;
@l = ();
if (@l > $n) {
push @out, sprintf $format, @l;
@l = ();
@@
-48,5
+50,5
@@
unless (@in) {
push @out, sprintf $format, @l;
}
push @out, sprintf $format, @l;
}
-push @out, "show/badip:
" . scalar @out . "
records found";
+push @out, "show/badip:
$count
records found";
return (1, @out);
return (1, @out);