gluon-mesh-batman-adv: don't parse ip output for nodeinfo
This commit is contained in:
parent
4795fc4a50
commit
117f9b4662
@ -1,8 +1,12 @@
|
||||
local ip = util.exec('ip -o -6 addr show dev br-client')
|
||||
local ip = require 'luci.ip'
|
||||
|
||||
local addresses = {}
|
||||
for _, line in ipairs(util.split(ip)) do
|
||||
table.insert(addresses, line:match('inet6 ([%x:]+)/'))
|
||||
|
||||
for line in io.lines('/proc/net/if_inet6') do
|
||||
local matches = { line:match('^' .. string.rep('(%x%x%x%x)', 8) .. string.rep(' %x%x', 4) .. '%s+([^%s]+)$') }
|
||||
if matches[9] == 'br-client' then
|
||||
table.insert(addresses, ip.IPv6(string.format('%s:%s:%s:%s:%s:%s:%s:%s', unpack(matches))):string():lower())
|
||||
end
|
||||
end
|
||||
|
||||
return addresses
|
||||
|
Loading…
Reference in New Issue
Block a user