Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
9264a54c
Commit
9264a54c
authored
Mar 04, 2013
by
Simó Albert i Beltran
Browse files
Fix 'qmpinfo ipv4' in roaming mode, close #215.
parent
46576674
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/qmp-small-node/files/etc/qmp/qmpinfo.lua
View file @
9264a54c
...
...
@@ -164,9 +164,15 @@ end
function
qmpinfo
.
get_ipv4
()
local
ipv4
=
{}
local
ipv4_raw
=
util
.
exec
(
"ip -4 a |
grep inet | awk '{print $2}' | awk -F/ '
{print $
1
}'
| grep -v 127.0.0.1
"
)
local
ipv4_raw
=
util
.
exec
(
"ip -4 a |
awk '/inet/
{print $
2
}'"
)
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
))
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment