projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5841fce
)
libs/sys: fix luci.sys.wifi.channels()
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 19 Jan 2011 21:37:01 +0000
(21:37 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 19 Jan 2011 21:37:01 +0000
(21:37 +0000)
libs/sys/luasrc/sys.lua
patch
|
blob
|
history
diff --git
a/libs/sys/luasrc/sys.lua
b/libs/sys/luasrc/sys.lua
index 817217b900978e8bb4a7de28a6df69b37a0b0cc5..1cf8b9f1865e4f5e2a0575f2f324a9aaeac82f9e 100644
(file)
--- a/
libs/sys/luasrc/sys.lua
+++ b/
libs/sys/luasrc/sys.lua
@@
-722,10
+722,14
@@
end
-- @param iface Wireless interface (optional)
-- @return Table of available channels
function wifi.channels(iface)
- local
t = iwinfo.type(iface or "
")
+ local
stat, iwinfo = pcall(require, "iwinfo
")
local cns
- if iface and t and iwinfo[t] then
- cns = iwinfo[t].freqlist(iface)
+
+ if stat then
+ local t = iwinfo.type(iface or "")
+ if iface and t and iwinfo[t] then
+ cns = iwinfo[t].freqlist(iface)
+ end
end
if not cns or #cns == 0 then