summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd')
-rw-r--r--applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd22
1 files changed, 22 insertions, 0 deletions
diff --git a/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd b/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
new file mode 100644
index 000000000..01b85de25
--- /dev/null
+++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
@@ -0,0 +1,22 @@
+#!/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 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='Base 64 key'
+uci set fwknopd.@access[0].hkeytype='Base 64 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 commit fwknopd
+rm -f /tmp/luci-indexcache
+exit 0