Skip to content
Snippets Groups Projects
Commit 59a3ad01 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

netifd: wireless: iopsys_utils: alternate approach to getting interface status

parent 09715c96
No related tags found
No related merge requests found
Pipeline #22 failed
...@@ -115,6 +115,7 @@ remove_disabled_vifs() { ...@@ -115,6 +115,7 @@ remove_disabled_vifs() {
local cfg=$1 local cfg=$1
local vif=$2 local vif=$2
#config_load network
config_get is_lan $cfg is_lan "0" config_get is_lan $cfg is_lan "0"
config_get type $cfg type config_get type $cfg type
...@@ -126,6 +127,14 @@ remove_disabled_vifs() { ...@@ -126,6 +127,14 @@ remove_disabled_vifs() {
[ -n "${ifc/wlan*/}" ] && continue [ -n "${ifc/wlan*/}" ] && continue
vif_cfg=$(uci show wireless | grep @wifi-iface | grep "ifname=\'$ifc\'" | awk -F '.' '{print $2}') vif_cfg=$(uci show wireless | grep @wifi-iface | grep "ifname=\'$ifc\'" | awk -F '.' '{print $2}')
#test=$(ubus call uci get '{"config":"wireless", "type":"wifi-iface", "match":{"ifname":"'$ifc'"}}' | grep "\.name" | awk -F ' ' '{print $2}')
#vif_cfg="${test//[\",]}"
#
#config_load wireless
#config_get device $vif_cfg device
#config_get radio_disabled $device disabled
#config_get disabled $vif_cfg disabled
#config_get net $vif_cfg network
device=$(uci -q get wireless.$vif_cfg.device) device=$(uci -q get wireless.$vif_cfg.device)
radio_disabled=$(uci -q get wireless.$device.disabled) radio_disabled=$(uci -q get wireless.$device.disabled)
...@@ -142,6 +151,13 @@ network_remove_disabled_vifs() { ...@@ -142,6 +151,13 @@ network_remove_disabled_vifs() {
config_foreach remove_disabled_vifs interface config_foreach remove_disabled_vifs interface
} }
network_add_vifs() {
nets=$(uci show network | grep network.*.interface | awk -F'[.,=]' '{print$2}')
config_load wireless
config_foreach add_to_network wifi-iface "$nets"
}
add_to_network() { add_to_network() {
local cfg=$1 local cfg=$1
local nets=$2 local nets=$2
...@@ -175,11 +191,4 @@ add_to_network() { ...@@ -175,11 +191,4 @@ add_to_network() {
uci -q set network.$net.ifname="$(echo $ifname | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/[ \t]*$//')" uci -q set network.$net.ifname="$(echo $ifname | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/[ \t]*$//')"
done done
uci commit network uci commit network
}
network_add_vifs() {
nets=$(uci show network | grep network.*.interface | awk -F'[.,=]' '{print$2}')
config_load wireless
config_foreach add_to_network wifi-iface "$nets"
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment