From: Nicolas Boisselier Date: Thu, 23 May 2019 13:40:06 +0000 (+0100) Subject: bin/iwtop X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=8ed81bb941d12807e8bf5115d74125121e8a8d9f;p=nb.git bin/iwtop --- diff --git a/bin/iwtop b/bin/iwtop index 0d0ff167..63f40df7 100755 --- a/bin/iwtop +++ b/bin/iwtop @@ -10,9 +10,10 @@ $_ = @ARGV ? ' '.join(' ',@ARGV) : ''; my ( $int, $cell, - %net + %net, ); +my $speed_size = ''; while (<>) { /^([\w:_-]+)/ and $int = $1 and next; @@ -27,7 +28,12 @@ while (<>) { $net{$k}{frequency} = $1; $net{$k}{channel} = $2; } - /Bit Rates: *(.*)/ and $net{$k}{speed} = $1; + if (/Bit Rates: *(.*)/) { + $net{$k}{speed} = $1; + #warn length($1).' <'.$1.'>' if !$speed_size or $speed_size) { } #die Dumper \%net; -my $fmt = "%5s | %17s | %9s | %2s | %10s | %3s | %3s | %s\n"; +$speed_size = 33; +my $fmt = "%6s | %17s | %9s | %2s | %".$speed_size."s | %3s | %3s | %s\n"; printf $fmt,'INT','MAC','FREQ','CH','SPEED','SIG','QLT','NAME'; for my $k (sort { ($net{$b}{signal}||0) <=> ($net{$a}{signal}||0)