summaryrefslogtreecommitdiffhomepage
path: root/libs/sys/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-27 16:29:33 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-27 16:29:33 +0000
commite8490c385facaca9ceb2b15303f3ebc3a0b3c722 (patch)
tree5125e9cb7d5543c36226a3ff7e651b174c2f7b71 /libs/sys/luasrc
parent0cdf9d7ead3027da368910f6e08a784948681cc4 (diff)
libs/sys: lazy load iwinfo
Diffstat (limited to 'libs/sys/luasrc')
-rw-r--r--libs/sys/luasrc/sys.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua
index c0ee4a1d1..d1137b76a 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -30,15 +30,14 @@ local os = require "os"
local table = require "table"
local nixio = require "nixio"
local fs = require "nixio.fs"
-local iwinfo = require "iwinfo"
local uci = require "luci.model.uci"
local luci = {}
luci.util = require "luci.util"
luci.ip = require "luci.ip"
-local tonumber, ipairs, pairs, pcall, type, next, setmetatable =
- tonumber, ipairs, pairs, pcall, type, next, setmetatable
+local tonumber, ipairs, pairs, pcall, type, next, setmetatable, require =
+ tonumber, ipairs, pairs, pcall, type, next, setmetatable, require
--- LuCI Linux and POSIX system utilities.
@@ -625,6 +624,8 @@ wifi = {}
-- @param ifname String containing the interface name
-- @return A wrapped iwinfo object instance
function wifi.getiwinfo(ifname)
+ local iwinfo = require "iwinfo"
+
if ifname then
local c = 0
local u = uci.cursor_state()