luci-app-shadowsocks-libev: enumerate ifnames with sys.net.devices()
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
parent
f5fa1a0f08
commit
4b042bcbd9
1 changed files with 3 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
local _up = getfenv(3)
|
local _up = getfenv(3)
|
||||||
local ut = require("luci.util")
|
local ut = require("luci.util")
|
||||||
|
local sys = require("luci.sys")
|
||||||
local ds = require("luci.dispatcher")
|
local ds = require("luci.dispatcher")
|
||||||
local nw = require("luci.model.network")
|
local nw = require("luci.model.network")
|
||||||
nw.init()
|
nw.init()
|
||||||
|
@ -56,10 +57,8 @@ function values_ipaddr(o)
|
||||||
end
|
end
|
||||||
|
|
||||||
function values_ifnames(o)
|
function values_ifnames(o)
|
||||||
for _, v in ipairs(nw:get_interfaces()) do
|
for _, v in ipairs(sys.net.devices()) do
|
||||||
if v.dev then
|
o:value(v)
|
||||||
o:value(v.dev.name)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue