Skip to content

Commit

Permalink
Merge pull request #3096 from herbetom/v2022.1.x-patches
Browse files Browse the repository at this point in the history
[v2022.1.x]: backport network reconfiguration patches
  • Loading branch information
blocktrron committed Dec 12, 2023
2 parents 1d0a30f + 2942961 commit d9f53a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,23 @@ for iface in pairs(interfaces) do
end
end

-- Fix invalid role configurations

uci:foreach('gluon', 'interface', function(interface)

local function has_role(role)
if interface.role == nil then
return false
end

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')

0 comments on commit d9f53a8

Please sign in to comment.