1
0
mirror of https://github.com/limosek/zaf-plugins.git synced 2025-01-21 07:25:56 +01:00

Repaired functions of iwx

This commit is contained in:
Lukas Macura 2016-12-07 16:47:17 +01:00
parent fcc76c0072
commit 45ae337483
2 changed files with 87 additions and 128 deletions

View File

@ -4,7 +4,7 @@ Description::
Plugin for wifi mac80211 informations and discovery
::
Version: 0.3
Version: 0.4
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/iwx
Web: https://github.com/limosek/zaf-plugins

View File

@ -1,59 +1,19 @@
wifi_ifphylist_openwrt() {
local devs phys p ifname ifindex i
if [ -f /usr/share/libubox/jshn.sh ]; then
. /usr/share/libubox/jshn.sh
json_load "$(ubus -S call network.wireless status)"
json_get_keys phys
for p in $phys; do
if [ "$1" = "phy" ]; then
echo $p
continue
fi
json_select "$p"
json_select "interfaces"
json_get_keys ifindex
for i in $ifindex; do
json_select $i
json_get_var ifname ifname
echo $ifname
json_select ..
done
json_select ..
json_select ..
done
else
wifi_ifphylist "$1"
fi
}
wifi_ifphylist() {
local i
if [ "$1" = "phy" ]; then
for i in 0 1 2 3 4 5 6; do
if zaf_sudo iw phy phy$i info >/dev/null 2>/dev/null; then
echo phy$i
fi
done
iw dev | grep Interface | cut -d ' ' -f 2
else
for i in 0 1 2 3 4 5 6; do
if zaf_sudo iw dev wlan$i info >/dev/null 2>/dev/null; then
echo wlan$i
fi
done
iw phy | grep Wiphy | cut -d ' ' -f 2
fi
}
wifi_iflist(){
zaf_os_specific wifi_ifphylist || wifi_ifphylist
wifi_ifphylist
}
wifi_phylist(){
zaf_os_specific wifi_ifphylist phy || wifi_ifphylist phy
wifi_ifphylist phy
}
wifi_scan_dump(){
@ -198,4 +158,3 @@ wifi_client_txrate(){
)
}