a7c433f2bc9e65d9b6663ba5021e3d12c7abe00d
[project/luci.git] / applications / luci-app-fwknopd / root / etc / uci-defaults / luci-fwknopd
1 #!/bin/sh
2 #-- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
3 #-- Licensed to the public under the GNU General Public License v2.
4
5 uci batch <<EOF
6         add ucitrack fwknopd
7         set ucitrack.@fwknopd[-1].init=fwknopd
8         commit ucitrack
9 EOF
10
11 if [ -f /usr/bin/fwknop ]; then
12         uci set fwknopd.@access[0].keytype='Base 64 key'
13         uci set fwknopd.@access[0].hkeytype='Base 64 key'
14         uci set fwknopd.@access[0].KEY_BASE64=`fwknop --key-gen | awk '/^KEY/ {print $2;}'`
15         uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknop --key-gen | awk '/^HMAC/ {print $2;}'`
16         uci commit fwknopd
17 fi
18 rm -f /tmp/luci-indexcache
19 exit 0