From 33023fe6a009674830f21f575436115efbaaf22d Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 23 May 2013 19:09:59 +0200 Subject: add iwlist_env --- usr/bin/iwlist_env | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 usr/bin/iwlist_env (limited to 'usr/bin') diff --git a/usr/bin/iwlist_env b/usr/bin/iwlist_env new file mode 100755 index 00000000..fcd9627d --- /dev/null +++ b/usr/bin/iwlist_env @@ -0,0 +1,33 @@ +#!/bin/sh + +count=0 + +iwlist scan ${interface:-} 2>/dev/null | while read line; +do + case "$line" in + *"Cell "*) + echo + : $((count+=1)) + echo MAC_${count}="${line#*Address: }" + ;; + *Channel:*) + echo CHANNEL_${count}="${line#*:}" + ;; + *Quality=*) + echo QUALITY_${count}="`printf '%s' ${line#*Quality=} | cut -d/ -f 1`" + ;; + *"Encryption key:"*) + echo ENCRYPTION_${count}="${line#*key:}" + ;; + *ESSID:*) + echo ESSID_${count}="${line#*ESSID:}" + ;; + *"IE: IEEE 802.11i/WPA2"*) + echo WPA2_${count}=1 + ;; + *"IE: WPA Version 1"*) + echo WPA_${count}=1 + ;; + *);; + esac +done -- cgit v1.2.3 From a1a677d33e68c019d9fdecb29e57164d69e8aa03 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 23 May 2013 19:34:38 +0200 Subject: update iwlist_env --- usr/bin/iwlist_env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/bin') diff --git a/usr/bin/iwlist_env b/usr/bin/iwlist_env index fcd9627d..29112ff3 100755 --- a/usr/bin/iwlist_env +++ b/usr/bin/iwlist_env @@ -2,11 +2,11 @@ count=0 -iwlist scan ${interface:-} 2>/dev/null | while read line; +iwlist scan ${1:-} 2>/dev/null | ( while read line; do case "$line" in *"Cell "*) - echo + #echo : $((count+=1)) echo MAC_${count}="${line#*Address: }" ;; @@ -30,4 +30,4 @@ do ;; *);; esac -done +done; echo WIFI_COUNT=$count) -- cgit v1.2.3