Added wifi encrypt
This commit is contained in:
parent
2eb15bac0e
commit
badbe68a1c
13
package/gluon-wlan-encryption-psk/Makefile
Normal file
13
package/gluon-wlan-encryption-psk/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gluon-wlan-encryption-psk
|
||||
PKG_VERSION:=1
|
||||
|
||||
include ../gluon.mk
|
||||
|
||||
define Package/gluon-wlan-encryption-psk
|
||||
TITLE:=Encrypt wlan using a pre-shared key (psk)
|
||||
DEPENDS:=+gluon-core +wpad-mesh-wolfssl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackageGluon,gluon-wlan-encryption-psk))
|
15
package/gluon-wlan-encryption-psk/Readme.md
Normal file
15
package/gluon-wlan-encryption-psk/Readme.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Gluon wlan encrypt
|
||||
Encrypt wireless networks in a non-Freifunk setup.
|
||||
|
||||
This package allows to encrypt 802.11s and infrastructure networks using a pre shared key (psk).
|
||||
|
||||
This setup results in passwords being stored in plain-text. Site-configuration, Firmware-downloads and
|
||||
Devices must be protected against unauthorized access
|
||||
|
||||
*make sure to use exclude hostapd-mini site.mk*
|
||||
|
||||
Example configuration:
|
||||
|
||||
```lua
|
||||
wlan_encryption_psk = { mesh = '802.11s.passwd', ap = ' infrastructure.passwd', },
|
||||
```
|
1
package/gluon-wlan-encryption-psk/check_site.lua
Normal file
1
package/gluon-wlan-encryption-psk/check_site.lua
Normal file
@ -0,0 +1 @@
|
||||
need_table({'wlan_encryption_psk'})
|
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local site = require 'gluon.site'
|
||||
local uci = require('simple-uci').cursor()
|
||||
|
||||
local ap_password = site.wlan_encryption_psk()["ap"]
|
||||
local mesh_password = site.wlan_encryption_psk()["mesh"]
|
||||
|
||||
|
||||
uci:foreach('wireless', 'wifi-iface', function(wifi_if)
|
||||
local ifname = wifi_if['.name']
|
||||
if wifi_if.mode == 'ap' and ap_password ~= nil and ap_password ~= '' then
|
||||
uci:set('wireless', ifname, 'encryption', 'psk2')
|
||||
uci:set('wireless', ifname, 'key', ap_password)
|
||||
elseif wifi_if.mode == "mesh" and mesh_password ~= nil and mesh_password ~= '' then
|
||||
uci:set('wireless', ifname, 'encryption', 'psk2/aes')
|
||||
uci:set('wireless', ifname, 'key', mesh_password)
|
||||
end
|
||||
end)
|
||||
|
||||
uci:save('wireless')
|
Loading…
Reference in New Issue
Block a user