summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
blob: 87d79e58b982a7af46cbb23ac4244a2d289d98d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#-- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
#-- Licensed to the public under the GNU General Public License v2.
. /lib/functions/network.sh

[ "$(uci -q get fwknopd.@access[0].KEY)" != "CHANGEME" ] && exit 0
uci batch <<EOF
	add ucitrack fwknopd
	set ucitrack.@fwknopd[-1].init=fwknopd
	commit ucitrack
EOF

uci delete fwknopd.@access[0].KEY
uci delete fwknopd.@access[0].HMAC_KEY
uci set fwknopd.@access[0].keytype='Base64 key'
uci set fwknopd.@access[0].hkeytype='Base64 key'
uci set fwknopd.@access[0].KEY_BASE64=`fwknopd --key-gen | awk '/^KEY/ {print $2;}'`
uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknopd --key-gen | awk '/^HMAC/ {print $2;}'`
uci set fwknopd.@config[0].ENABLE_IPT_FORWARDING='y'
uci set fwknopd.@config[0].ENABLE_NAT_DNS='y'

uci commit fwknopd
rm -f /tmp/luci-indexcache
exit 0