1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Added wifi-list

This commit is contained in:
Starbeamrainbowlabs 2016-04-20 13:04:35 +01:00
parent b27bb67426
commit 1851aacba0
2 changed files with 28 additions and 0 deletions

2
wifi-list Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo iw wlan0 scan | awk -f ~/bin/wifi-list.awk

26
wifi-list.awk Normal file
View file

@ -0,0 +1,26 @@
$1 == "BSS" {
MAC = $2
wifi[MAC]["enc"] = "Open"
}
$1 == "SSID:" {
wifi[MAC]["SSID"] = $2
}
$1 == "freq:" {
wifi[MAC]["freq"] = $NF
}
$1 == "signal:" {
wifi[MAC]["sig"] = $2 " " $3
}
$1 == "WPA:" {
wifi[MAC]["enc"] = "WPA"
}
$1 == "WEP:" {
wifi[MAC]["enc"] = "WEP"
}
END {
printf "%s\t\t%s\t%s\t\t%s\n","SSID","Frequency","Signal","Encryption"
for (w in wifi) {
printf "%s\t\t%s\t\t%s\t%s\n",wifi[w]["SSID"],wifi[w]["freq"],wifi[w]["sig"],wifi[w]["enc"]
}
}