docker-dnscache/rootfs/app/entrypoint.sh
paspo 1600112965
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
env params
2025-03-24 11:33:24 +01:00

40 lines
750 B
Bash
Executable File

#!/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