env params
This commit is contained in:
parent
c1cd0ea0d4
commit
1600112965
@ -1,5 +1,39 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
LOGS=${LOGS:-false}
|
||||||
|
LOGDIR=${LOGDIR:-/logs}
|
||||||
|
PORT=${PORT:-1053}
|
||||||
|
VERBOSITY=${VERBOSITY:-1}
|
||||||
|
|
||||||
|
# set logs
|
||||||
|
if [ "${LOGS}" = true ] ; then
|
||||||
|
mkdir -p "${LOGDIR}"
|
||||||
|
chown unbound:unbound "${LOGDIR}"
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/logs.conf << EOF
|
||||||
|
server:
|
||||||
|
verbosity: ${VERBOSITY}
|
||||||
|
log-queries: yes
|
||||||
|
log-replies: yes
|
||||||
|
logfile: "${LOGDIR}/unbound.log"
|
||||||
|
log-time-ascii: yes
|
||||||
|
log-servfail: yes
|
||||||
|
log-local-actions: yes
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/logs.conf << EOF
|
||||||
|
server:
|
||||||
|
verbosity: ${VERBOSITY}
|
||||||
|
log-queries: no
|
||||||
|
log-replies: no
|
||||||
|
logfile: ""
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set port
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/port.conf << EOF
|
||||||
|
server:
|
||||||
|
port: ${PORT}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# start unbound
|
||||||
/usr/sbin/unbound -d
|
/usr/sbin/unbound -d
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
interface: 0.0.0.0
|
interface: 0.0.0.0
|
||||||
port: 1053
|
|
||||||
do-ip4: yes
|
do-ip4: yes
|
||||||
do-ip6: no
|
do-ip6: no
|
||||||
do-udp: yes
|
do-udp: yes
|
||||||
@ -10,14 +9,6 @@ server:
|
|||||||
cache-max-ttl: 86400
|
cache-max-ttl: 86400
|
||||||
prefetch: yes
|
prefetch: yes
|
||||||
num-threads: 4
|
num-threads: 4
|
||||||
verbosity: 1
|
|
||||||
# log-queries: yes
|
|
||||||
log-queries: no
|
|
||||||
# log-replies: yes
|
|
||||||
logfile: ""
|
|
||||||
log-time-ascii: yes
|
|
||||||
log-servfail: yes
|
|
||||||
# log-local-actions: yes
|
|
||||||
use-syslog: no
|
use-syslog: no
|
||||||
msg-cache-slabs: 8
|
msg-cache-slabs: 8
|
||||||
rrset-cache-slabs: 8
|
rrset-cache-slabs: 8
|
||||||
@ -36,3 +27,4 @@ dynlib:
|
|||||||
remote-control:
|
remote-control:
|
||||||
control-enable: yes
|
control-enable: yes
|
||||||
control-interface: /run/unbound.control.sock
|
control-interface: /run/unbound.control.sock
|
||||||
|
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user