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

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

parent 9510d03b
No related branches found
No related tags found
No related merge requests found
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'])
end
local ifname = line:match('^(.-):')
if ifname ~= nil then
pcall(
function()
table.insert(interfaces, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')))
end
)
end
end
return interfaces
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment