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-fwknopd18
1 files changed, 7 insertions, 11 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
index 7cecf2746..5fed1889d 100644
--- a/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
+++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/40_luci-fwknopd
@@ -3,16 +3,12 @@
#-- 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
+# Clean-up - keytype/hkeytype is unnecessary now
+if uci -q show fwknopd | grep \\.h\\?keytype > /dev/null; then
+ for keytype in $(uci -q show fwknopd | grep \\.h\\?keytype= | cut -d= -f1); do
+ uci delete $keytype
+ done
+ uci commit fwknopd
+fi
-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
exit 0