Skip to content

Commit

Permalink
Wifi scan parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Good committed Dec 15, 2011
1 parent 027e3b6 commit 49379a1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wifiscanparse
Original file line number Diff line number Diff line change
@@ -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()}

0 comments on commit 49379a1

Please sign in to comment.