X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fnode.pl;h=53a974ca1627f30b3e926aa913fa1076faa329af;hb=35432a9f25350b9a5db513efbe248b61176b0684;hp=9bc77e2a031f454c51c3983ce58c000c6cd4f179;hpb=32849fc856cb0cb825657c0013dfefb125a96bab;p=spider.git diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 9bc77e2a..53a974ca 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -17,25 +17,29 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 1; +use DB_File; + my @call = map {uc $_} split /\s+/, $line; my @out; +my $count; # search thru the user for nodes -unless (@call) { - use DB_File; - - my ($action, $count, $key, $data); - for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { +if ($call[0] eq 'ALL') { + shift @call; + my ($action, $key, $data) = (0,0,0); + for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { if ($data =~ m{sort => '[ACRSX]'}) { push @call, $key; + ++$count; } - ++$count; } +} elsif (@call == 0) { + @call = map {$_->call} DXChannel::get_all_nodes(); } my $call; foreach $call (@call) { - my $clref = DXCluster->get_exact($call); + my $clref = Route::Node::get($call); my $uref = DXUser->get_current($call); my ($sort, $ver); @@ -58,7 +62,7 @@ foreach $call (@call) { $sort = "Spider"; $ver = $main::version; } else { - $ver = $clref->pcversion if $clref && $clref->pcversion; + $ver = $clref->version if $clref && $clref->version; } my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver; @@ -67,6 +71,7 @@ foreach $call (@call) { } else { push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : " "); } + ++$count; } return (1, @out, $self->msg('rec', $count));