X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fusers.pl;h=a3fb3cc26ee510aeae8879bacd99a52f34d7c258;hb=097f2329b24fd3082e880e789f8a38224784b0e0;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/cmd/show/users.pl b/cmd/show/users.pl index e69de29b..a3fb3cc2 100644 --- a/cmd/show/users.pl +++ b/cmd/show/users.pl @@ -0,0 +1,57 @@ +# +# show the users on this cluster from the routing tables +# +# Copyright (c) 1998 Dirk Koopman G1TLH +# +# $Id$ +# + +my ($self, $line) = @_; +my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes +my @out; + +if (@list) { + foreach my $call (sort @list) { + my $uref = DXUser->get_current($call); + if ($uref) { + my $name = $uref->name || '?'; + my $qth = $uref->qth || '?'; + my $qra = $uref->qra || ''; + my $route = ''; + if (my $rref = Route::get($call)) { + $route = '(at ' . join(',', $rref->parents) . ')'; + } + push @out, "$call $route $name $qth $qra", + } else { + push @out, $self->msg('usernf', $call); + } + } +} else { + my $node = $main::routeroot; + push @out, join(' ', $self->msg('userconn'), $main::mycall); + my $call; + my $i = 0; + my @l; + my @val = sort $node->users; + foreach $call (@val) { + if ($i >= 5) { + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l; + @l = (); + $i = 0; + } + my $uref = Route::User::get($call); + my $s = $call; + if ($uref) { + $s = sprintf "(%s)", $call unless $uref->here; + } else { + $s = "$call?"; + } + push @l, $s; + $i++; + } + push @l, "" while $i++ < 5; + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l; +} + +return (1, @out); +