Restart LQM when changing channel (#1318)

* Restart LQM if we change wifi channel

* Fix test
This commit is contained in:
Tim Wilkinson 2024-08-18 23:21:10 -07:00 committed by GitHub
parent d5b0046f99
commit 3ca3ed4a79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -1294,7 +1294,9 @@ local config_special = {
ssh_access = c:get("aredn", "@wan[0]", "ssh_access"),
telnet_access = c:get("aredn", "@wan[0]", "telnet_access"),
wifi_mode_0 = c:get("wireless", "@wifi-iface[0]", "mode"),
wifi_mode_1 = c:get("wireless", "@wifi-iface[1]", "mode")
wifi_mode_1 = c:get("wireless", "@wifi-iface[1]", "mode"),
wifi_channel_0 = c:get("wireless", "@wifi-device[0]", "channel"),
wifi_channel_1 = c:get("wireless", "@wifi-device[1]", "channel")
}
local nfiles = {}
for file in nixio.fs.glob("/tmp/new_config/*")
@ -1354,6 +1356,9 @@ do
changes.firewall = true
elseif file == "wireless" then
local oc = uci:cursor()
if oc:get("wireless", "@wifi-device[0]", "channel") ~= config_special.wifi_channel_0 or oc:get("wireless", "@wifi-device[1]", "channel") ~= config_special.wifi_channel_1 then
changes.manager = true
end
if oc:get("wireless", "@wifi-iface[0]", "mode") ~= config_special.wifi_mode_0 or oc:get("wireless", "@wifi-iface[1]", "mode") ~= config_special.wifi_mode_1 then
-- Only start the hostapd (etc) if we need to. This doesn't change what is currently running
-- only what automatically runs in the future