X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fwho.pl;h=b068c586aa38a381d930c04253d665966763c687;hb=9b65e70322b24190bb5f677ccedcc000ab4625d2;hp=34e2d0a4369b354a2f80865373d49978c84615ba;hpb=5acd1be649672f6e5bd2b4a6772b51cd935ebda9;p=spider.git diff --git a/cmd/who.pl b/cmd/who.pl index 34e2d0a4..b068c586 100644 --- a/cmd/who.pl +++ b/cmd/who.pl @@ -1,24 +1,40 @@ -# -# who : is online -# a complete list of stations connected -# -# Copyright (c) 1999 Dirk Koopman G1TLH -# -# $Id$ - - -my $self = shift; -my $dxchan; -my @out; - -push @out, " Callsign Type Started Name"; - -foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { - my $call = $dxchan->call(); - my $t = cldatetime($dxchan->user->lastin); - my $sort = $dxchan->is_ak1a() ? "NODE" : "USER"; - my $name = $dxchan->user->name; - push @out, sprintf "%10s $sort $t $name", $call; -} - -return (1, @out) +# +# who : is online +# a complete list of stations connected +# +# Copyright (c) 1999 Dirk Koopman G1TLH +# +# + + +my $self = shift; +my $dxchan; +my @out; + +push @out, " Callsign Type Started Name Ave RTT Link"; + +foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { + my $call = $dxchan->call(); + my $t = cldatetime($dxchan->startt); + my $type = $dxchan->is_node ? "NODE" : "USER"; + my $sort = " "; + if ($dxchan->is_node) { + $sort = 'ANEA' if $dxchan->is_aranea; + $sort = "DXSP" if $dxchan->is_spider; + $sort = "CLX " if $dxchan->is_clx; + $sort = "DXNT" if $dxchan->is_dxnet; + $sort = "AR-C" if $dxchan->is_arcluster; + $sort = "AK1A" if $dxchan->is_ak1a; + } + my $name = $dxchan->user->name || " "; + my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%5.2f", $dxchan->pingave) : " "; + my $conn = $dxchan->conn; + my $ip = ''; + if ($conn) { + $ip = $conn->{peerhost} if exists $conn->{peerhost}; + $ip = "AGW Port ($conn->{agwport})" if exists $conn->{agwport}; + } + push @out, sprintf "%10s $type $sort $t %-10.10s $ping $ip", $call, $name; +} + +return (1, @out)