Skip to content
Snippets Groups Projects
Unverified Commit b019c703 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-mesh-vpn-fastd: reduce complexity of upgrade script

parent 64725858
No related branches found
No related tags found
No related merge requests found
...@@ -74,23 +74,19 @@ local function add_group(name, config, parent) ...@@ -74,23 +74,19 @@ local function add_group(name, config, parent)
peer_limit = config.limit, peer_limit = config.limit,
}) })
if config.peers then for peername, peerconfig in pairs(config.peers or {}) do
for peername, peerconfig in pairs(config.peers) do
add_peer(name, peername, peerconfig) add_peer(name, peername, peerconfig)
end end
end
add_groups(name, config.groups, name) add_groups(name, config.groups, name)
end end
-- declared local above -- declared local above
function add_groups(prefix, groups, parent) function add_groups(prefix, groups, parent)
if groups then for name, group in pairs(groups or {}) do
for name, group in pairs(groups) do
add_group(prefix .. '_' .. name, group, parent) add_group(prefix .. '_' .. name, group, parent)
end end
end end
end
add_groups('mesh_vpn', site.mesh_vpn.fastd.groups()) add_groups('mesh_vpn', site.mesh_vpn.fastd.groups())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment