X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;fp=cmd%2Fshow%2Fconfiguration.pl;h=62beea66a7334ffb27724ecfaa8fff7ba350bf63;hb=2546ef0cfaaca39e65985e414258071a636979af;hp=0000000000000000000000000000000000000000;hpb=fdc1150da7dbd9c1094d8df7a4744fb917017ed2;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl new file mode 100644 index 00000000..62beea66 --- /dev/null +++ b/cmd/show/configuration.pl @@ -0,0 +1,43 @@ +# +# show the cluster routing tables to the user +# +# Copyright (c) 1998 Dirk Koopman G1TLH +# +# $Id$ +# + +my ($self, $line) = @_; +my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes +my @out; +my @nodes = (DXNode::get_all()); +my $node; + +push @out, "Node Callsigns"; +foreach $node (@nodes) { + if (@list) { + next if !grep $node->call eq $_, @list; + } + my $i = 0; + my @l; + my $call = $node->call; + $call = "($call)" if $node->here == 0; + push @l, $call; + my $nlist = $node->list; + my @val = values %{$nlist}; + foreach $call (@val) { + if ($i >= 5) { + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; + @l = (); + push @l, ""; + $i = 0; + } + my $s = $call->{call}; + $s = sprintf "(%s)", $s if $call->{here} == 0; + push @l, $s; + $i++; + } + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; +} + + +return (1, @out);