1
0

40_luci-fwknopd 839 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. #-- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
  3. #-- Licensed to the public under the GNU General Public License v2.
  4. . /lib/functions/network.sh
  5. [ "$(uci -q get fwknopd.@access[0].KEY)" != "CHANGEME" ] && exit 0
  6. uci batch <<EOF
  7. add ucitrack fwknopd
  8. set ucitrack.@fwknopd[-1].init=fwknopd
  9. commit ucitrack
  10. EOF
  11. uci delete fwknopd.@access[0].KEY
  12. uci delete fwknopd.@access[0].HMAC_KEY
  13. uci set fwknopd.@access[0].keytype='Base 64 key'
  14. uci set fwknopd.@access[0].hkeytype='Base 64 key'
  15. uci set fwknopd.@access[0].KEY_BASE64=`fwknopd --key-gen | awk '/^KEY/ {print $2;}'`
  16. uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknopd --key-gen | awk '/^HMAC/ {print $2;}'`
  17. uci set fwknopd.@config[0].ENABLE_IPT_FORWARDING='y'
  18. uci set fwknopd.@config[0].ENABLE_NAT_DNS='y'
  19. uci commit fwknopd
  20. rm -f /tmp/luci-indexcache
  21. exit 0