Commit Diff
Diff:
a5813c03de662bad043210357a51941abcb7ab77
51f8d37a9c2a22932ddeeb3a84afdeb6acb703f0
Commit:
51f8d37a9c2a22932ddeeb3a84afdeb6acb703f0
Tree:
ae8a1ea847bc1fb9910a7314f4cf1a2c531d26d2
Author:
alienus <alienusATcahouetDOTnet>
Committer:
alienus <alienusATcahouetDOTnet>
Date:
Tue Apr 21 18:43:03 2015 UTC
Message:
sort seems to be useless for array now in 5.20.1 in 5.7 && desc is sometimes not defined
blob - c803ad214711c998d98ab093bb29ea0cef8239a9
blob + 3714fa724b3544972270f17d06670bdc903d76e4
--- rezo
+++ rezo
@@ -11,7 +11,7 @@ use strict;
use warnings;
use 5.010;
use Getopt::Long;
-#use Data::Dumper;
+use Data::Dumper;
# check root
( $< == 0 ) or die "Sorry, but only root can play with networks, aborting...\n";
@@ -20,7 +20,7 @@ use Getopt::Long;
my $VERSION = '0.0';
# wireless interface & ifconfig path
-my $nwif = 'iwn0';
+my $nwif = 'wpi0';
my $ifconfig = '/sbin/ifconfig';
# help
@@ -77,7 +77,7 @@ sub scan {
}
close SCANR;
# sort by dB
- @netlist = sort { $b->[6] cmp $a->[6] } @netlist;
+ #@netlist = sort { $b->[6] cmp $a->[6] } @netlist;
return @netlist;
}
scan();
@@ -85,10 +85,17 @@ scan();
my $inet = @netlist;
sub test {
+ say "-" x72;
+ say "Nb\tdB\tSSID";
+ say "-" x72;
for my $i (0 .. ($inet - 1) ) {
my $nb = $i +1;
$netlist[$i][1] =~ s/~~~/ /g;
- say "$nb:\t$netlist[$i][6]:\t$netlist[$i][1]";
+ $netlist[$i][8] = '-o-o-' unless defined($netlist[$i][8]);
+#my ($nwid,$SSID,$chan,$channb,$bssid,$bssidn,$db,$agn,$desc);
+ say "$nb:\t$netlist[$i][6]\t$netlist[$i][1]\t$netlist[$i][8]";
}
}
test();
+
+#say Dumper @netlist;
Frédéric Galusik