mirror of
https://github.com/limosek/zaf-plugins.git
synced 2025-01-21 23:45:56 +01:00
Repaired functions of iwx
This commit is contained in:
parent
fcc76c0072
commit
45ae337483
@ -4,7 +4,7 @@ Description::
|
|||||||
Plugin for wifi mac80211 informations and discovery
|
Plugin for wifi mac80211 informations and discovery
|
||||||
::
|
::
|
||||||
|
|
||||||
Version: 0.3
|
Version: 0.4
|
||||||
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/iwx
|
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/iwx
|
||||||
Web: https://github.com/limosek/zaf-plugins
|
Web: https://github.com/limosek/zaf-plugins
|
||||||
|
|
||||||
|
@ -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() {
|
wifi_ifphylist() {
|
||||||
local i
|
|
||||||
|
|
||||||
if [ "$1" = "phy" ]; then
|
if [ "$1" = "phy" ]; then
|
||||||
for i in 0 1 2 3 4 5 6; do
|
iw dev | grep Interface | cut -d ' ' -f 2
|
||||||
if zaf_sudo iw phy phy$i info >/dev/null 2>/dev/null; then
|
|
||||||
echo phy$i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
for i in 0 1 2 3 4 5 6; do
|
iw phy | grep Wiphy | cut -d ' ' -f 2
|
||||||
if zaf_sudo iw dev wlan$i info >/dev/null 2>/dev/null; then
|
|
||||||
echo wlan$i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
wifi_iflist(){
|
wifi_iflist(){
|
||||||
zaf_os_specific wifi_ifphylist || wifi_ifphylist
|
wifi_ifphylist
|
||||||
}
|
}
|
||||||
|
|
||||||
wifi_phylist(){
|
wifi_phylist(){
|
||||||
zaf_os_specific wifi_ifphylist phy || wifi_ifphylist phy
|
wifi_ifphylist phy
|
||||||
}
|
}
|
||||||
|
|
||||||
wifi_scan_dump(){
|
wifi_scan_dump(){
|
||||||
@ -198,4 +158,3 @@ wifi_client_txrate(){
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user