start.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. DO_IPV6=${DO_IPV6:-yes}
  3. DO_IPV4=${DO_IPV4:-yes}
  4. DO_UDP=${DO_UDP:-yes}
  5. DO_TCP=${DO_TCP:-yes}
  6. VERBOSITY=${VERBOSITY:-0}
  7. NUM_THREADS=${NUM_THREADS:-1}
  8. SO_RCVBUFF=${SO_RCVBUFF:-0}
  9. SO_SNDBUF=${SO_SNDBUF:-0}
  10. SO_REUSEPORT=${SO_REUSEPORT:-no}
  11. EDNS_BUFFER_SIZE=${EDNS_BUFFER_SIZE:-4096}
  12. MSG_CACHE_SIZE=${MSG_CACHE_SIZE:-4m}
  13. RRSET_CACHE_SIZE=${RRSET_CACHE_SIZE:-4m}
  14. CACHE_MIN_TTL=${CACHE_MIN_TTL:-0}
  15. CACHE_MAX_TTL=${CACHE_MAX_TTL:-86400}
  16. CACHE_MAX_NEGATIVE_TTL=${CACHE_MAX_NEGATIVE_TTL:-3600}
  17. HIDE_IDENTITY=${HIDE_IDENTITY:-no}
  18. HIDE_VERSION=${HIDE_VERSION:-no}
  19. STATISTICS_INTERVAL=${STATISTICS_INTERVAL:-0}
  20. STATISTICS_CUMULATIVE=${STATISTICS_CUMULATIVE:-no}
  21. EXTENDED_STATISTICS=${EXTENDED_STATISTICS:-no}
  22. sed 's/{{DO_IPV6}}/'"${DO_IPV6}"'/' -i /etc/unbound/unbound.conf
  23. sed 's/{{DO_IPV4}}/'"${DO_IPV4}"'/' -i /etc/unbound/unbound.conf
  24. sed 's/{{DO_UDP}}/'"${DO_UDP}"'/' -i /etc/unbound/unbound.conf
  25. sed 's/{{DO_TCP}}/'"${DO_TCP}"'/' -i /etc/unbound/unbound.conf
  26. sed 's/{{VERBOSITY}}/'"${VERBOSITY}"'/' -i /etc/unbound/unbound.conf
  27. sed 's/{{NUM_THREADS}}/'"${NUM_THREADS}"'/' -i /etc/unbound/unbound.conf
  28. sed 's/{{SO_RCVBUFF}}/'"${SO_RCVBUFF}"'/' -i /etc/unbound/unbound.conf
  29. sed 's/{{SO_SNDBUF}}/'"${SO_SNDBUF}"'/' -i /etc/unbound/unbound.conf
  30. sed 's/{{SO_REUSEPORT}}/'"${SO_REUSEPORT}"'/' -i /etc/unbound/unbound.conf
  31. sed 's/{{EDNS_BUFFER_SIZE}}/'"${EDNS_BUFFER_SIZE}"'/' -i /etc/unbound/unbound.conf
  32. sed 's/{{MSG_CACHE_SIZE}}/'"${MSG_CACHE_SIZE}"'/' -i /etc/unbound/unbound.conf
  33. sed 's/{{RRSET_CACHE_SIZE}}/'"${RRSET_CACHE_SIZE}"'/' -i /etc/unbound/unbound.conf
  34. sed 's/{{CACHE_MIN_TTL}}/'"${CACHE_MIN_TTL}"'/' -i /etc/unbound/unbound.conf
  35. sed 's/{{CACHE_MAX_TTL}}/'"${CACHE_MAX_TTL}"'/' -i /etc/unbound/unbound.conf
  36. sed 's/{{CACHE_MAX_NEGATIVE_TTL}}/'"${CACHE_MAX_NEGATIVE_TTL}"'/' -i /etc/unbound/unbound.conf
  37. sed 's/{{HIDE_IDENTITY}}/'"${HIDE_IDENTITY}"'/' -i /etc/unbound/unbound.conf
  38. sed 's/{{HIDE_VERSION}}/'"${HIDE_VERSION}"'/' -i /etc/unbound/unbound.conf
  39. sed 's/{{STATISTICS_INTERVAL}}/'"${STATISTICS_INTERVAL}"'/' -i /etc/unbound/unbound.conf
  40. sed 's/{{STATISTICS_CUMULATIVE}}/'"${STATISTICS_CUMULATIVE}"'/' -i /etc/unbound/unbound.conf
  41. sed 's/{{EXTENDED_STATISTICS}}/'"${EXTENDED_STATISTICS}"'/' -i /etc/unbound/unbound.conf
  42. exec unbound -d -v