Developing lightweight computation at the DSG edge

Commit 6a8c3a22 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Import "Fix 'qmpinfo ipv4' in roaming mode", references #215.

Conflicts:
	packages/qmp-small-node/files/etc/qmp/qmpinfo.lua
parents 0a07ef48 9264a54c
...@@ -168,9 +168,15 @@ end ...@@ -168,9 +168,15 @@ end
function qmpinfo.get_ipv4() function qmpinfo.get_ipv4()
local ipv4 = {} local ipv4 = {}
local ipv4_raw = util.exec("ip -4 a | awk '/inet/&&!/bmx6_/{print $2}'") local ipv4_raw = util.exec("ip -4 a | awk '/inet/{print $2}'")
for _,v in ipairs(util.split(ipv4_raw)) do for _,v in ipairs(util.split(ipv4_raw)) do
if #util.trim(v) > 1 then local match = false
local i = 1
while i <= #ipv4 and not match do
match = string.match(util.trim(v),util.trim(ipv4[i]))
i = i + 1
end
if not match and #util.trim(v) > 1 then
table.insert(ipv4,util.trim(v)) table.insert(ipv4,util.trim(v))
end end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment