gluon-mesh-batman-adv: fix network.mesh_inferfaces announce field with new netifd

This commit is contained in:
Matthias Schiffer 2014-07-28 16:29:20 +02:00
parent 9510d03b8b
commit 354508752c

View File

@ -1,14 +1,14 @@
require 'ubus'
local conn = ubus.connect()
local list = util.exec('batctl if')
local interfaces = {}
for _, line in ipairs(util.split(list)) do
local ifname = line:match('^(.-):')
if ifname ~= nil then
local status = conn:call("network.device", "status", { name = ifname })
table.insert(interfaces, status['macaddr'])
pcall(
function()
table.insert(interfaces, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')))
end
)
end
end