summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2014-10-10 15:48:54 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2014-10-10 15:48:54 +0300
commit2a0e842d00d6bc3b01b52f36553549ec2adf0d95 (patch)
treed31eb5c050834d58dee6acf31f783d0a07e06521 /modules/admin-full/luasrc
parentccdc6535a9e1eefa109bc491a204e32281d13063 (diff)
wifi.lua: Add support for toggling WPS button.
The patch checks the existence of the needed files for the WPS support and if they are present, shows the option to toggle WPS pushbutton settings. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
index 2253752f4..f6becf0f4 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
@@ -975,4 +975,18 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
end
+if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
+ local wpasupplicant = fs.access("/usr/sbin/wpa_supplicant")
+ local hostcli = fs.access("/usr/sbin/hostapd_cli")
+ if hostcli and wpasupplicant then
+ wps = s:taboption("encryption", Flag, "wps_pushbutton", translate("Enable WPS pushbutton, requires WPA(2)-PSK"))
+ wps.enabled = "1"
+ wps.disabled = "0"
+ wps.rmempty = false
+ wps:depends("encryption", "psk")
+ wps:depends("encryption", "psk2")
+ wps:depends("encryption", "psk-mixed")
+ end
+end
+
return m