From 49379a105fa5e96d413a53bee11e6077e180548a Mon Sep 17 00:00:00 2001 From: Isaac Good Date: Thu, 15 Dec 2011 15:03:20 -0500 Subject: [PATCH] Wifi scan parser --- wifiscanparse | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 wifiscanparse diff --git a/wifiscanparse b/wifiscanparse new file mode 100755 index 0000000..80129e2 --- /dev/null +++ b/wifiscanparse @@ -0,0 +1,15 @@ +#!/usr/bin/awk -f + +# Parse the output of iwlist scan and show the stuff I care about + +function display() { + printf "%2s %1s %19s %9s %s\n", q, e, ap, m, n|"sort -n" +} + +$1 == "Cell" && f {display()} +$1 == "Cell" {ap = $5; f=1} +$1 ~ /^Quality=/ {split($1, a, /[=/]/); q=a[2]} +$1 == "Encryption" {if($2 == "key:on") e="!"; else e="o"} +$1 ~ /^ESSID:/ {split($0, a, /:/); n=a[2]} +$1 ~ /^Mode:/ {split($0, a, /:/); m=a[2]} +END{display()}