mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
self-diagnostics: update wifi data collection
This commit is contained in:
parent
f4fa5821e5
commit
ee13ac5774
4 changed files with 66 additions and 10 deletions
|
|
@ -1,11 +1,30 @@
|
||||||
interfaces=$(uci show wireless | grep "ifname=" | awk -F'[.,=]' '{print$2}')
|
. /lib/functions.sh
|
||||||
for int in $interfaces; do
|
|
||||||
mode=$(uci get "wireless.${int}.mode")
|
handle_interface() {
|
||||||
|
local config="${1}"
|
||||||
|
local prefix="${2}"
|
||||||
|
|
||||||
|
config_get ifname "${config}" ifname
|
||||||
|
config_get mode ${config} mode
|
||||||
|
|
||||||
if [ "$mode" = "ap" ] ; then
|
if [ "$mode" = "ap" ] ; then
|
||||||
ap_int=$(uci get "wireless.${int}.ifname")
|
echo "Get assoc list for ${ifname}"
|
||||||
echo "Get assoc list for ${ap_int}"
|
ubus call "${prefix}.${ifname}" assoclist
|
||||||
ubus call "wifi.ap.${ap_int}" assoclist
|
echo "Get station info for ${ifname}"
|
||||||
echo "Get station info for ${ap_int}"
|
ubus call "${prefix}.${ifname}" stations
|
||||||
ubus call "wifi.ap.${ap_int}" stations
|
|
||||||
fi
|
fi
|
||||||
done
|
}
|
||||||
|
|
||||||
|
handle_wifi_interface() {
|
||||||
|
handle_interface "$1" "wifi.ap"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_mld_interface() {
|
||||||
|
handle_interface "$1" "wifi.apmld"
|
||||||
|
}
|
||||||
|
|
||||||
|
config_load wireless
|
||||||
|
echo "Get associated stations information for non-MLD interfaces"
|
||||||
|
config_foreach handle_wifi_interface wifi-iface
|
||||||
|
echo "Get associated stations information for MLD interfaces"
|
||||||
|
config_foreach handle_mld_interface wifi-mld
|
||||||
|
|
|
||||||
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_sta.sh
Normal file → Executable file
0
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_sta.sh
Normal file → Executable file
36
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_status.sh
Executable file
36
self-diagnostics/files/usr/share/self-diagnostics/helper/wifi_status.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
handle_interface() {
|
||||||
|
local config="${1}"
|
||||||
|
local prefix="${2}"
|
||||||
|
|
||||||
|
config_get ifname "${config}" ifname
|
||||||
|
config_get mode ${config} mode
|
||||||
|
|
||||||
|
if [ "$mode" = "ap" ] ; then
|
||||||
|
echo "Get status for ${ifname}"
|
||||||
|
ubus call "${prefix}.${ifname}" status
|
||||||
|
elif [ "$mode" = "sta" ] ; then
|
||||||
|
echo "Get status for bSTA ${ifname}"
|
||||||
|
ubus call "wifi.bsta.${ifname}" status
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_wifi_interface() {
|
||||||
|
handle_interface "$1" "wifi.ap"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_mld_interface() {
|
||||||
|
handle_interface "$1" "wifi.apmld"
|
||||||
|
}
|
||||||
|
|
||||||
|
config_load wireless
|
||||||
|
echo "Get wifi status"
|
||||||
|
ubus call wifi status
|
||||||
|
|
||||||
|
echo "Get wifi status for ap & bsta interfaces"
|
||||||
|
config_foreach handle_wifi_interface wifi-iface
|
||||||
|
|
||||||
|
echo "Get wifi status for apmld interfaces"
|
||||||
|
config_foreach handle_mld_interface wifi-mld
|
||||||
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "WiFi Status",
|
"description": "WiFi Status",
|
||||||
"cmd": "ubus call wifi status"
|
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_status.sh",
|
||||||
|
"timeout": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "WiFi Radio Status",
|
"description": "WiFi Radio Status",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue