From: djk Date: Tue, 25 May 1999 13:21:40 +0000 (+0000) Subject: added who command X-Git-Tag: R_1_28~1 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=5acd1be649672f6e5bd2b4a6772b51cd935ebda9;p=spider.git added who command --- diff --git a/Changes b/Changes index 4b6cefaa..9ea91d1a 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ 2. got rid of the stupid bug that failed to print out the offline message but put a "*main::STDOUTmain" for every line of that message instead. 3. Ported to 5.00503 (well actually just installed it and it just runs). +4. Added who command 23May99======================================================================= 1. Got rid of some of the useless error messages on global destruction when quiting a program. diff --git a/cmd/Aliases b/cmd/Aliases index 3aaddb28..9c5094e4 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -36,7 +36,7 @@ package CmdAlias; ], 'd' => [ '^del', 'kill', 'kill', - '^del.*/fu', 'kill full', 'kill', + '^del\w*/fu', 'kill full', 'kill', '^di\w*/a\w*', 'directory all', 'directory', '^di\w*/b\w*', 'directory bulletins', 'directory', '^di\w*/n\w*', 'directory new', 'directory', @@ -91,6 +91,7 @@ package CmdAlias; '^set/noww', 'unset/wwv', 'unset/wwv', '^set/nowx', 'unset/wx', 'unset/wx', '^sh$', 'show', 'show', + '^sh\w*/bu', 'show/files bulletins', 'show/files', '^sh\w*/c/n', 'show/configuration nodes', 'show/configuration', '^sh\w*/c$', 'show/configuration', 'show/configuration', '^sh\w*/dx/(\d+)-(\d+)', 'show/dx $1-$2', 'show/dx', diff --git a/cmd/who.pl b/cmd/who.pl new file mode 100644 index 00000000..34e2d0a4 --- /dev/null +++ b/cmd/who.pl @@ -0,0 +1,24 @@ +# +# 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)