34 lines
861 B
Lua
Executable File
34 lines
861 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local uci = require('luci.model.uci').cursor()
|
|
local site = require 'gluon.site_config'
|
|
local interfaces='/lib/gluon/core/mesh_interfaces'
|
|
|
|
if site.mesh_on_wan then
|
|
uci:section('babeld', 'interface', 'mesh_wan',
|
|
{
|
|
ifname = 'br-wan',
|
|
}
|
|
)
|
|
|
|
uci:add_to_set('firewall', 'mesh_babel', 'network', 'wan')
|
|
end
|
|
|
|
uci:delete_all('babeld', 'interface')
|
|
|
|
pcall(function()
|
|
for interface in io.lines(interfaces) do
|
|
int = string.gsub(interface,'[.-]','_')
|
|
uci:section('babeld', 'interface', 'interface_' .. int, { ifname = interface })
|
|
end
|
|
end)
|
|
|
|
uci:add_to_set('firewall', 'mesh_babel', 'network', 'client')
|
|
uci:add_to_set('firewall', 'mesh_babel', 'network', 'local_node4')
|
|
uci:add_to_set('firewall', 'mesh_babel', 'network', 'local_node6')
|
|
|
|
uci:save('babeld')
|
|
uci:save('firewall')
|
|
uci:commit('babeld')
|
|
uci:commit('firewall')
|