gluon-mesh-batman-adv: fix network.mesh_inferfaces announce field with new netifd
This commit is contained in:
parent
9510d03b8b
commit
354508752c
@ -1,15 +1,15 @@
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user