X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fversion.pl;h=0b0f0cfb66df9645b7675af023173a2810f48c22;hb=4b7dbe2c98c3694692b28584f096ae0c479a3174;hp=fb84ab2cbdf50320a3f8ebfa33732648d5cb397d;hpb=c7dcee3eb996f8a0741ce11ca3615af7cca8ca63;p=spider.git diff --git a/cmd/show/version.pl b/cmd/show/version.pl index fb84ab2c..0b0f0cfb 100644 --- a/cmd/show/version.pl +++ b/cmd/show/version.pl @@ -3,31 +3,29 @@ # # Copyright (c) 1998 Dirk Koopman G1TLH # -# $Id$ +# # +my ($self, $line) = @_; my @out; -my $build = $main::version; +my @in = map {uc} split /\s+/, $line; -use IO::File; +if ($self->priv > 5 && @in) { +# $DB::single=1; -if (opendir(DIR, "$main::root/perl")) { - my @d = readdir(DIR); - closedir(DIR); - foreach my $fn (@d) { - if ($fn =~ /^cluster\.pl$/ || $fn =~ /\.pm$/) { - my $f = new IO::File $fn or next; - while (<$f>) { - if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)/ ) { - $build += $1; - last; - } - } - $f->close; - } + my $q = $in[0] eq 'ALL' ? '.*' : join('|', @in); + my @n = sort {$a->call cmp $b->call} grep {$_->call =~ /^(?:$q)/} Route::Node::get_all(); + push @out, " Node Version Build PC9X via PC92"; + foreach my $n (@n) { + push @out, sprintf " %-10s %5d %5s %3s %3s", $n->call, $n->version, $n->build, yesno($n->do_pc9x), yesno($n->via_pc92); } + push @out, ' ' . scalar @n . " Nodes found"; +} else { + my ($year) = (gmtime($main::systime))[5]; + $year += 1900; + push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitbranch/$main::gitversion) on \u$^O"; + push @out, "Copyright (c) 1998-$year Dirk Koopman G1TLH"; } -push @out, "DX Spider Cluster version $main::version (build $build) on \u$^O"; -push @out, "Copyright (c) 1998-2001 Dirk Koopman G1TLH"; + return (1, @out);