From: djk Date: Mon, 3 Jan 2000 15:51:30 +0000 (+0000) Subject: added show/node for G4PDQ X-Git-Tag: R_1_39~26 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=b32338a1d9e22f4297bf6a971d2903d5952180cd;p=spider.git added show/node for G4PDQ --- diff --git a/Changes b/Changes index 32cd3f9b..60122d84 100644 --- 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 index 00000000..e51b97c3 --- /dev/null +++ b/cmd/show/node.pl @@ -0,0 +1,61 @@ +# +# show/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); diff --git a/perl/Messages b/perl/Messages index 75c24c2c..33fa718b 100644 --- a/perl/Messages +++ b/perl/Messages @@ -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]',