Skip to content
Snippets Groups Projects
Commit a31a802e authored by lemoer's avatar lemoer
Browse files

gluon-core: fix invalid role configurations during reconfigure

parent 1e21dbcf
No related branches found
No related tags found
No related merge requests found
...@@ -63,4 +63,19 @@ for iface in pairs(interfaces) do ...@@ -63,4 +63,19 @@ for iface in pairs(interfaces) do
end end
end end
-- Fix invalid role configurations
uci:foreach('gluon', 'interface', function(interface)
local function has_role(role)
return util.contains(interface.role, role)
end
if has_role('client') and (has_role('mesh') or has_role('uplink')) then
-- remove 'client' role
util.remove_from_set(interface.role, 'client')
uci:set('gluon', interface['.name'], 'role', interface.role)
end
end)
uci:save('gluon') uci:save('gluon')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment