mirror of https://github.com/lcpz/lain.git
#68 solution attempt
This commit is contained in:
parent
a250f4d3fc
commit
89bb71e154
|
@ -31,9 +31,9 @@ function net.get_device()
|
||||||
f = io.popen("ip link show | cut -d' ' -f2,9")
|
f = io.popen("ip link show | cut -d' ' -f2,9")
|
||||||
ws = f:read("*a")
|
ws = f:read("*a")
|
||||||
f:close()
|
f:close()
|
||||||
ws = ws:match("%w+: UP")
|
ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN")
|
||||||
if ws ~= nil then
|
if ws ~= nil then
|
||||||
return ws:gsub(": UP", "")
|
return ws:match("(%w+):")
|
||||||
else
|
else
|
||||||
return "network off"
|
return "network off"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue