2017-08-17 16:37:44 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# The methods used in this script are taken from airmon-ng.
|
|
|
|
# This is all thanks for the airmon-ng authors, thanks guys.
|
|
|
|
|
|
|
|
function interface_list_all() {
|
|
|
|
InterfaceListAll=($(ls -1 /sys/class/net))
|
|
|
|
}
|
|
|
|
|
|
|
|
function interface_list_wireless() {
|
|
|
|
InterfaceListWireless=()
|
|
|
|
interface_list_all
|
|
|
|
local __interface_list_wireless__candidate
|
|
|
|
for __interface_list_wireless__candidate in "${InterfaceListAll[@]}"; do
|
2017-08-17 16:45:48 -06:00
|
|
|
if grep -qs "DEVTYPE=wlan" /sys/class/net/$__interface_list_wireless__candidate/uevent
|
2017-08-17 16:37:44 -06:00
|
|
|
then InterfaceListWireless+=("$__interface_list_wireless__candidate")
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|