summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-fwknopd/root
diff options
context:
space:
mode:
authorJonathan Bennett <JBennett@incomsystems.biz>2015-05-08 23:30:02 -0500
committerJonathan Bennett <JBennett@incomsystems.biz>2015-05-12 21:10:00 -0500
commitfd130d0ce7f52480ccc8bd600fb66de1b36fdbb9 (patch)
tree2567c81a1158f40f2163b748a9521485dd8d5120 /applications/luci-app-fwknopd/root
parentcc99288242be3e0fe60b61b83bebe272222560c5 (diff)
Add initial luci-app-fwknopd - a way to control the firewall knock daemon from luci
Signed-off-by: Jonathan Bennett <jbennett@incomsystems.biz>
Diffstat (limited to 'applications/luci-app-fwknopd/root')
-rw-r--r--applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd19
1 files changed, 19 insertions, 0 deletions
diff --git a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd
new file mode 100644
index 000000000..a7c433f2b
--- /dev/null
+++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd
@@ -0,0 +1,19 @@
+#!/bin/sh
+#-- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
+#-- Licensed to the public under the GNU General Public License v2.
+
+uci batch <<EOF
+ add ucitrack fwknopd
+ set ucitrack.@fwknopd[-1].init=fwknopd
+ commit ucitrack
+EOF
+
+if [ -f /usr/bin/fwknop ]; then
+ 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=`fwknop --key-gen | awk '/^KEY/ {print $2;}'`
+ uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknop --key-gen | awk '/^HMAC/ {print $2;}'`
+ uci commit fwknopd
+fi
+rm -f /tmp/luci-indexcache
+exit 0