Make it work with badip system active
[spider.git] / cmd / load / badip.pl
1 #
2 # load list of bad dx nodes
3 #
4 # Copyright (c) 2023 - Dirk Koopman G1TLH
5 #
6 #
7 my ($self, $line) = @_;
8 return (1, $self->msg('e5')) if $self->remotecmd;
9 # are we permitted?
10 return (1, $self->msg('e5')) if $self->priv < 6;
11 return (1, q{Please install Net::CIDR::Lite or libnet-cidr-lite-perl to use this command}) unless $DXCIDR::active;
12
13 my @out;
14
15 my $count = 0;
16 eval{ $count += DXCIDR::reload(); };
17 return (1, "load/badip: $_ $@") if $@;
18
19 push @out, "load/badip: added $count entries";
20 return (1, @out);