r4693 - developers/werner/bin

werner at docs.openmoko.org werner at docs.openmoko.org
Mon Oct 6 10:26:16 CEST 2008


Author: werner
Date: 2008-10-06 10:25:56 +0200 (Mon, 06 Oct 2008)
New Revision: 4693

Added:
   developers/werner/bin/wlanscan
Log:
Little utility to extract the relevant information from an iwlist scan.



Added: developers/werner/bin/wlanscan
===================================================================
--- developers/werner/bin/wlanscan	                        (rev 0)
+++ developers/werner/bin/wlanscan	2008-10-06 08:25:56 UTC (rev 4693)
@@ -0,0 +1,43 @@
+#!/bin/sh
+iwlist scan 2>/dev/null | awk '
+function flush()
+{
+    printf("%3s %-32s %9s dBm %s\n", cell, essid, signal, crypt)
+    cell = "?"
+    essid = "?"
+    signal = "?"
+    crypt = "?"
+}
+
+/^ *Cell/ {
+    if (cell != "")
+	flush()
+    match($0, /[0-9]+/)
+    cell = substr($0, RSTART, RLENGTH)
+}
+/^ *ESSID:/ {
+    match($0, /"[^"]*"/)
+    essid = substr($0, RSTART+1, RLENGTH-2)
+}
+/^ *Quality/ {
+    match($0, /Signal level=[^ ]* /)
+    signal = substr($0, RSTART+13, RLENGTH-14)
+    match($0, /Noise level=[^ ]* /)
+    signal = signal "/" substr($0, RSTART+12, RLENGTH-13)
+}
+/^ *Encryption key:off/ {
+    crypt = "open"
+}
+/^ *Encryption key:on/ {
+    crypt = "WEP"
+}
+/^ *IE: WPA/ {
+    crypt = "WPA"
+}
+/^ *Extra:wpa_ie/ {
+    crypt = "WPA"
+}
+END {
+    if (cell != "")
+	flush()
+}'


Property changes on: developers/werner/bin/wlanscan
___________________________________________________________________
Name: svn:executable
   + *




More information about the commitlog mailing list