You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.5 KiB

  1. #!/bin/sh
  2. ##############################################################################
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License version 2 as
  6. # published by the Free Software Foundation.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # Copyright (C) 2016 Eric Luehrsen
  14. #
  15. ##############################################################################
  16. # while useful (sh)ellcheck is pedantic and noisy
  17. # shellcheck disable=1091,2002,2004,2034,2039,2086,2094,2140,2154,2155
  18. # where are we?
  19. UB_ETCDIR=/etc/unbound
  20. UB_LIBDIR=/usr/lib/unbound
  21. UB_VARDIR=/var/lib/unbound
  22. UB_PIDFILE=/var/run/unbound.pid
  23. # conf deconstructed
  24. UB_CORE_CONF=$UB_VARDIR/server.conf.tmp
  25. UB_HOST_CONF=$UB_VARDIR/host.conf.tmp
  26. UB_ZONE_CONF=$UB_VARDIR/zone.conf.tmp
  27. UB_CTRL_CONF=$UB_VARDIR/ctrl.conf.tmp
  28. UB_SRVMASQ_CONF=$UB_VARDIR/dnsmasq_srv.conf.tmp
  29. UB_EXTMASQ_CONF=$UB_VARDIR/dnsmasq_ext.conf.tmp
  30. # conf as found
  31. UB_TOTAL_CONF=$UB_VARDIR/unbound.conf
  32. UB_DHCP_CONF=$UB_VARDIR/dhcp.conf
  33. UB_SRV_CONF=$UB_VARDIR/unbound_srv.conf
  34. UB_EXT_CONF=$UB_VARDIR/unbound_ext.conf
  35. # resolver file complex
  36. UB_RESOLV_CONF=/tmp/resolv.conf
  37. UB_RESOLV_AUTO=/tmp/resolv.conf.d/resolv.conf.auto
  38. # TLS keys
  39. UB_TLS_KEY_FILE="TLS server UCI not implemented"
  40. UB_TLS_PEM_FILE="TLS server UCI not implemented"
  41. UB_TLS_ETC_FILE=/etc/ssl/certs/ca-certificates.crt
  42. # start files
  43. UB_RKEY_FILE=$UB_VARDIR/root.key
  44. UB_RHINT_FILE=$UB_VARDIR/root.hints
  45. UB_TIME_FILE=$UB_VARDIR/hotplug.time
  46. UB_SKIP_FILE=$UB_VARDIR/skip.time
  47. # control app keys
  48. UB_CTLKEY_FILE=$UB_ETCDIR/unbound_control.key
  49. UB_CTLPEM_FILE=$UB_ETCDIR/unbound_control.pem
  50. UB_SRVKEY_FILE=$UB_ETCDIR/unbound_server.key
  51. UB_SRVPEM_FILE=$UB_ETCDIR/unbound_server.pem
  52. # similar default SOA / NS RR as Unbound uses for private ARPA zones
  53. UB_XSER=$(( $( date +%s ) / 60 ))
  54. UB_XSOA="7200 IN SOA localhost. nobody.invalid. $UB_XSER 3600 1200 9600 300"
  55. UB_XNS="7200 IN NS localhost."
  56. UB_XTXT="7200 IN TXT \"comment=local intranet dns zone\""
  57. UB_MTXT="7200 IN TXT \"comment=masked internet dns zone\""
  58. UB_LTXT="7200 IN TXT \"comment=rfc6762 multicast dns zone\""
  59. # helper apps
  60. UB_ANCHOR=/usr/sbin/unbound-anchor
  61. UB_CONTROL=/usr/sbin/unbound-control
  62. UB_CONTROL_CFG="$UB_CONTROL -c $UB_TOTAL_CONF"
  63. ##############################################################################