find_phy() {
[ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0
- [ -n "$path" -a -d "/sys/devices/$path/ieee80211" ] && {
- phy="$(ls /sys/devices/$path/ieee80211 | grep -m 1 phy)"
- [ -n "$phy" ] && return 0
+ [ -n "$path" ] && {
+ for phy in /sys/devices/$path/ieee80211/phy*; do
+ [ -e "$phy" ] && {
+ phy="${phy##*/}"
+ return 0
+ }
+ done
}
[ -n "$macaddr" ] && {
for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
json_get_vars bssid ssid key mcast_rate
keyspec=
- [ "$auth_type" == "wep" ] && {
+ [ "$auth_type" = "wep" ] && {
set_default key 1
case "$key" in
[1234])