mirror of https://github.com/lcpz/lain.git
#68 solution attempt
This commit is contained in:
parent
e759a7fe23
commit
1a654b327d
|
@ -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