added show/node for G4PDQ
authordjk <djk>
Mon, 3 Jan 2000 15:51:30 +0000 (15:51 +0000)
committerdjk <djk>
Mon, 3 Jan 2000 15:51:30 +0000 (15:51 +0000)
Changes
cmd/show/node.pl [new file with mode: 0644]
perl/Messages

diff --git a/Changes b/Changes
index 32cd3f9baa7fd9c571646f1627ee0dd86d2dbfac..60122d8406d96147adde4b280fcfe5caa798ef3b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@
 2. added sh/date with special "be compatible with ak1a" syntax for the output
 of sh/date with no arguments, otherwise the same as sh/time. A special favour
 to G4PDQ...
+3. and another one, added show/node especially for G4PDQ.
 01Jan00=======================================================================
 1. Fixed Julian routines to get rid of the millenium bug! (do as I say, not
 as I do!).
diff --git a/cmd/show/node.pl b/cmd/show/node.pl
new file mode 100644 (file)
index 0000000..e51b97c
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# show/node [<node> | <node> ] 
+# 
+# This command either lists all nodes known about 
+# or the ones specified on the command line together
+# with some information that is relavent to them 
+#
+# This command isn't and never will be compatible with AK1A
+#
+# A special millenium treat just for G4PDQ
+#
+# Copyright (c) 2000 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+return (1, $self->msg('e5')) unless $self->priv >= 1;
+
+my @call = map {uc $_} split /\s+/, $line; 
+my @out;
+
+# search thru the user for nodes
+unless (@call) {
+       @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls;
+}
+
+my $call;
+foreach $call (@call) {
+       my $clref = DXCluster->get_exact($call);
+       my $uref = DXUser->get_current($call);
+       my ($sort, $ver);
+       
+       my $pcall = sprintf "%-11s", $call;
+       push @out, $self->msg('snode1') unless @out > 0;
+       if ($uref) {
+               $sort = "Spider" if $uref->sort eq 'S';
+               $sort = "AK1A  " if $uref->sort eq 'A';
+               $sort = "clx   " if $uref->sort eq 'C';
+               $sort = "Fred  " if $uref->sort eq 'U';
+               $sort = "BBS   " if $uref->sort eq 'B';
+       } else {
+               push @out, $self->msg('snode3', $call);
+               next;
+       }
+       if ($call eq $main::mycall) {
+               $sort = "Spider";
+               $ver = $main::version;
+       } else {
+               $ver = $clref->pcversion if $clref && $clref->pcversion;
+       }
+       
+       my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver;
+       if ($sort eq 'Spider') {
+               push @out, $self->msg('snode2', $pcall, $sort, "$ver  ");
+       } else {
+               push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : "      ");
+       }
+}
+
+return (1, @out);
index 75c24c2cb106695ac1894f45528a53a472c18810..33fa718b04a19575995865daadeb2c572b351296 100644 (file)
@@ -148,6 +148,9 @@ package DXM;
                                read3 => 'Msg $_[0] not available',
                                shutting => '$main::mycall shutting down...',
                                sloc => 'Cluster lat $_[0] long $_[1], DON\'T FORGET TO CHANGE YOUR DXVars.pm',
+                               snode1 => 'Node Call   Sort    Version',
+                               snode2 => '$_[0] $_[1]  $_[2]',
+                               snode3 => '$_[0] Unknown Call',
                                sqra => 'Cluster QRA Locator$_[0], DON\'T FORGET TO CHANGE YOUR DXVars.pm',
                                sorry => 'Sorry',
                                spf1 => 'spoof: creating new user $_[0]',