From: Jo-Philipp Wich Date: Fri, 10 Oct 2014 13:07:43 +0000 (+0200) Subject: Merge pull request #219 from hnyman/WPS-toggle X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=fa13788fc70c02ce67ea7cbc16621d8475802859;hp=ccdc6535a9e1eefa109bc491a204e32281d13063 Merge pull request #219 from hnyman/WPS-toggle wifi.lua: Add support for toggling WPS button --- 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