gluon-config-mode-outdoor: enable 5GHz mesh interfaces when disabling outdoor mode
There is no setting to explicitly enable mesh interfaces in the config
wizard, so we need to enable mesh interfaces by default when the outdoor
mode is disabled (unless site.conf dictates otherwise).
The simplest way to achieve this is to delete the 5GHz mesh interface
sections when outdoor mode is disabled: 200-wireless would delete and
recreate them a moment later anyways, but by deleting them earlier we
ensure that the disabled status is initialized from site.conf again.
(cherry picked from commit 17bc622892
)
This commit is contained in:
parent
b466d00d3f
commit
ee473ce2a4
@ -21,6 +21,24 @@ return function(form, uci)
|
||||
if data ~= outdoor_mode then
|
||||
uci:set('gluon', 'wireless', 'outdoor', data)
|
||||
uci:save('gluon')
|
||||
|
||||
if data == false then
|
||||
local mesh_ifaces_5ghz = {}
|
||||
uci:foreach('wireless', 'wifi-device', function(config)
|
||||
if config.hwmode ~= '11a' and config.hwmode ~= '11na' then
|
||||
return
|
||||
end
|
||||
|
||||
local radio_name = config['.name']
|
||||
local mesh_iface = 'mesh_' .. radio_name
|
||||
table.insert(mesh_ifaces_5ghz, mesh_iface)
|
||||
end)
|
||||
for _, mesh_iface in ipairs(mesh_ifaces_5ghz) do
|
||||
uci:delete('wireless', mesh_iface)
|
||||
end
|
||||
uci:save('wireless')
|
||||
end
|
||||
|
||||
os.execute('/lib/gluon/upgrade/200-wireless')
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user