Device:retrieveNetworkInfo: Drop the "HWaddr" bit from the parsed output

i.e., just display "ifname MAC"
reviewable/pr10137/r1
NiLuJe 1 year ago
parent 6dc41fe02a
commit 203094d47d

@ -501,12 +501,13 @@ function Device:exit()
end
function Device:retrieveNetworkInfo()
-- NOTE: This sed monstrosity is tailored for the busybox implementation of ifconfig
local std_out = io.popen("ifconfig | " ..
"sed -n " ..
"-e 's/ \\+$//g' " ..
"-e 's/ \\+/ /g' " ..
"-e 's/ \\?inet6\\? addr: \\?\\([^ ]\\+\\) .*$/IP: \\1/p' " ..
"-e 's/Link encap:Ethernet\\(.*\\)/\\1/p'",
"-e 's/Link encap:Ethernet[[:blank:]]*HWaddr \\(.*\\)/\\1/p'",
"r")
if std_out then
local result = std_out:read("*all")

Loading…
Cancel
Save