Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:krebscode/minikrebs
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |