X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fstat%2Froute_node.pl;h=0c7f222471f6de74a7b4a116ed10fe4651d4834b;hb=refs%2Fheads%2Fstaging;hp=1cedcb4409a47674c3cc1e4c5c6e2850a0bb7364;hpb=273bb156dcab276845ac5984ccebfa2cc68b451a;p=spider.git diff --git a/cmd/stat/route_node.pl b/cmd/stat/route_node.pl index 1cedcb44..0c7f2224 100644 --- a/cmd/stat/route_node.pl +++ b/cmd/stat/route_node.pl @@ -3,22 +3,35 @@ # # Copyright (c) 2001 Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; +my @out; my @list = split /\s+/, $line; # generate a list of callsigns -@list = ($self->call) if !@list; # my channel if no callsigns +@list = ($self->call) unless @list; # my channel if no callsigns +if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') { + push @out, "Node Callsigns in Routing Table"; + @list = sort map {$_->call} Route::Node::get_all(); + my $count = @list; + my $n = int $self->width / 10; + $n ||= 8; + while (@list > $n) { + push @out, join(' ', map {sprintf "%9s",$_ } splice(@list, 0, $n)); + } + push @out, join(' ', map {sprintf "%9s",$_ } @list) if @list; + push @out, "$count Nodes"; + return (1, @out); +} my $call; -my @out; foreach $call (@list) { $call = uc $call; my $ref = Route::Node::get($call); if ($ref) { @out = print_all_fields($self, $ref, "Route::Node Information $call"); } else { - push @out, "Route::User: $call not found"; + push @out, "Route::Node: $call not found"; } push @out, "" if @list > 1; }