Results 1 to 1 of 1

Thread: Conky Script - WifiScan

  1. #1
    Join Date
    May 2010
    Beans
    1

    Smile Conky Script - WifiScan

    run under linux need perl and iwlist installed

    wifiscan.pl
    Code:
    #!/usr/bin/perl
    use strict;
    
    die "[-]Veuillez entrer une interface en argument\012" unless (@ARGV == 1);
    
    my $iface = shift;
    
    my @apz = split(/(.*\n.*\n.*\n.*\n)/, do{local($/); qx{iwlist $iface scanning |grep -E 'Address:|Channel:|ESSID:|Quality' |cut -c21-55}});
    
    map {$_ =~ s{(.*)\n(.*)\n(.*)\n(.*)\n} {$4\n$1\n$2\n$3}} @apz;
    
    foreach my $network (@apz)
    {
        print $network, "\n";
    }
    if you need root rule for running iwlist
    Code:
    chmod 6755 /usr/sbin/iwlist
    change rules for wifiscan.pl
    Code:
    chmod 755 -x wifiscan.pl
    in console using
    Code:
    wifiscan.pl wlan0
    conky using
    Code:
    ${iexecute 300 wifiscan.pl wlan0}
    if you have bug check is
    my @apz = split(/(.*\n.*\n.*\n.*\n)/, do{local($/); qx{iwlist $iface scanning |grep -E 'Address:|Channel:|ESSID:|Quality' |cut -c21-55}});
    is in ONE line
    Last edited by cariboo907; December 28th, 2010 at 03:48 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •