libs/sys: lazy load iwinfo
This commit is contained in:
parent
0cdf9d7ead
commit
e8490c385f
1 changed files with 4 additions and 3 deletions
|
@ -30,15 +30,14 @@ local os = require "os"
|
||||||
local table = require "table"
|
local table = require "table"
|
||||||
local nixio = require "nixio"
|
local nixio = require "nixio"
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local iwinfo = require "iwinfo"
|
|
||||||
local uci = require "luci.model.uci"
|
local uci = require "luci.model.uci"
|
||||||
|
|
||||||
local luci = {}
|
local luci = {}
|
||||||
luci.util = require "luci.util"
|
luci.util = require "luci.util"
|
||||||
luci.ip = require "luci.ip"
|
luci.ip = require "luci.ip"
|
||||||
|
|
||||||
local tonumber, ipairs, pairs, pcall, type, next, setmetatable =
|
local tonumber, ipairs, pairs, pcall, type, next, setmetatable, require =
|
||||||
tonumber, ipairs, pairs, pcall, type, next, setmetatable
|
tonumber, ipairs, pairs, pcall, type, next, setmetatable, require
|
||||||
|
|
||||||
|
|
||||||
--- LuCI Linux and POSIX system utilities.
|
--- LuCI Linux and POSIX system utilities.
|
||||||
|
@ -625,6 +624,8 @@ wifi = {}
|
||||||
-- @param ifname String containing the interface name
|
-- @param ifname String containing the interface name
|
||||||
-- @return A wrapped iwinfo object instance
|
-- @return A wrapped iwinfo object instance
|
||||||
function wifi.getiwinfo(ifname)
|
function wifi.getiwinfo(ifname)
|
||||||
|
local iwinfo = require "iwinfo"
|
||||||
|
|
||||||
if ifname then
|
if ifname then
|
||||||
local c = 0
|
local c = 0
|
||||||
local u = uci.cursor_state()
|
local u = uci.cursor_state()
|
||||||
|
|
Loading…
Reference in a new issue