X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=3101c5352f0466d95e615ee5d98bea914c928036;hb=refs%2Fheads%2Fip_address;hp=fe8acf9678c4027224ba65e7456570e97a31588f;hpb=679037f49e292b15a73dce96699c15b9e3049711;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index fe8acf96..3101c535 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -3,7 +3,7 @@ # # Copyright (c) 1998 Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; @@ -16,19 +16,22 @@ my @val; push @out, $self->msg('showconf'); if ($list[0] && $list[0] =~ /^NOD/) { - my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes(); + my %ch; my $dxchan; - foreach $dxchan (@ch) { - @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; + foreach my $n (@nodes) { + $dxchan = $n->dxchan; + push @{$ch{$dxchan->call}}, $n if $dxchan; + } + + foreach my $call (sort keys %ch) { + @val = sort {$a->call cmp $b->call} @{$ch{$call}}; @l = (); - my $call = $dxchan->call; - $call ||= '???'; - $call = "($call)" unless $dxchan->here; + $call = "($call)" unless DXChannel::get($call)->here; push @l, $call; foreach my $ref (@val) { - if (@l >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; @@ -38,7 +41,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; } - push @l, "" while @l < 5; + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { @@ -66,7 +69,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { push @l, sprintf "(%d users)", $node->usercount; } foreach $call (@val) { - if (@l >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; @@ -80,7 +83,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { } push @l, $s; } - push @l, "" while @l < 5; + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } }