Skip to content

Commit

Permalink
Merge branch 'master' of github.com:krebscode/minikrebs
Browse files Browse the repository at this point in the history
  • Loading branch information
lassulus committed May 23, 2013
2 parents ff7077f + a5a76bc commit b909d95
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions traits/network/autoconnect/files/usr/bin/iwlist_env
@@ -0,0 +1,33 @@
#!/bin/sh

count=0

iwlist scan ${1:-} 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; echo WIFI_COUNT=$count)

0 comments on commit b909d95

Please sign in to comment.