From 8383f6b9799eba944c612ae475e7f09ae88660b4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 19 Jan 2011 21:37:44 +0000 Subject: [PATCH] luci-0.10: merge r6757 --- libs/sys/luasrc/sys.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index 817217b90..1cf8b9f18 100644 --- 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 -- 2.25.1