safety first: section names, removing old mesh_interfaces

This commit is contained in:
Christof Schulze 2016-04-24 00:12:46 +02:00
parent ae42e979c1
commit 2c418a6e66

View File

@ -2,7 +2,7 @@
local uci = require('luci.model.uci').cursor()
local site = require 'gluon.site_config'
local interfaces='/lib/gluon/core/dynamic/interfaces'
local interfaces='/lib/gluon/core/mesh_interfaces'
if site.mesh_on_wan then
uci:section('babeld', 'interface', 'mesh_wan',
@ -14,9 +14,12 @@ if site.mesh_on_wan then
uci:add_to_set('firewall', 'mesh_babel', 'network', 'wan')
end
uci:delete_all('babeld', 'interface')
pcall( function()
for interface in io.lines(interfaces) do
uci:section('babeld', 'interface', interface, { ifname = interface })
int = string.gsub(interface,'[.-]','_')
uci:section('babeld', 'interface', 'interface_' .. int, { ifname = interface })
end
end)