gluon-mesh-vpn-fastd: reduce complexity of upgrade script
This commit is contained in:
parent
64725858b4
commit
b019c703c9
@ -74,22 +74,18 @@ local function add_group(name, config, parent)
|
||||
peer_limit = config.limit,
|
||||
})
|
||||
|
||||
if config.peers then
|
||||
for peername, peerconfig in pairs(config.peers) do
|
||||
for peername, peerconfig in pairs(config.peers or {}) do
|
||||
add_peer(name, peername, peerconfig)
|
||||
end
|
||||
end
|
||||
|
||||
add_groups(name, config.groups, name)
|
||||
end
|
||||
|
||||
-- declared local above
|
||||
function add_groups(prefix, groups, parent)
|
||||
if groups then
|
||||
for name, group in pairs(groups) do
|
||||
for name, group in pairs(groups or {}) do
|
||||
add_group(prefix .. '_' .. name, group, parent)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_groups('mesh_vpn', site.mesh_vpn.fastd.groups())
|
||||
|
Loading…
Reference in New Issue
Block a user