summaryrefslogtreecommitdiffhomepage
path: root/libs/sys/luasrc/sys.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-18 00:38:18 +0000
committerSteven Barth <steven@midlink.org>2008-08-18 00:38:18 +0000
commit0c3fc70ddbf3f0fc0dcbb5d7c05285b0b2d12ccb (patch)
treef5c3216521c20271c776c13e52f40cf16dc1a6c3 /libs/sys/luasrc/sys.lua
parent39444086375b7451952b273b8c53ff48b6766706 (diff)
Huuuuuuuuuuuge rewrite of the Wireless Configuration
Diffstat (limited to 'libs/sys/luasrc/sys.lua')
-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 970dcffaaa..d0dc5acbd8 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -432,8 +432,9 @@ end
--- Get iwlist scan output from all wireless devices.
-- @return Table of tables contaiing all scan results
-function wifi.iwscan()
- local cnt = luci.util.exec("iwlist scan 2>/dev/null")
+function wifi.iwscan(iface)
+ local siface = iface or ""
+ local cnt = luci.util.exec("iwlist "..siface.." scan 2>/dev/null")
local iws = {}
for i, l in pairs(luci.util.split(luci.util.trim(cnt), "\n\n")) do
@@ -451,7 +452,7 @@ function wifi.iwscan()
end
end
- return iws
+ return iface and (iws[iface] or {}) or iws
end