X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=09521cb6b7406e3d062994c90158243df744b857;hb=980ea8f908bcfc89be566b7b17d5579a7875200d;hp=3386a1716e5a65404ce7398a0d59378a6e712dd9;hpb=097f2329b24fd3082e880e789f8a38224784b0e0;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index 3386a171..09521cb6 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -20,28 +20,25 @@ if ($list[0] && $list[0] =~ /^NOD/) { my $dxchan; foreach $dxchan (@ch) { - @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; + @val = sort {$a->call cmp $b->call} grep { $_->dxchan && $_->dxchan == $dxchan } @nodes; @l = (); my $call = $dxchan->call; $call ||= '???'; $call = "($call)" unless $dxchan->here; push @l, $call; - my $i = 0; foreach my $ref (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $s = $ref->call; $s ||= '???'; $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { @@ -65,16 +62,14 @@ if ($list[0] && $list[0] =~ /^NOD/) { push @l, $call; @val = sort $node->users; - my $i = 0; if (@val == 0 && $node->usercount) { push @l, sprintf "(%d users)", $node->usercount; } foreach $call (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $uref = Route::User::get($call); my $s = $call; @@ -84,9 +79,8 @@ if ($list[0] && $list[0] =~ /^NOD/) { $s = "$call?"; } push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } }