docker-pdns/pdns-recursor/docker-cmd.sh
2018-11-06 22:51:45 +01:00

26 lines
588 B
Bash
Executable file

#!/bin/sh
set -euo pipefail
# Configure base vars
: "${PDNS_local_port:=53}"
: "${PDNS_local_address:=0.0.0.0}"
: "${PDNS_allow_from:=0.0.0.0/0}"
export PDNS_local_port PDNS_local_address PDNS_allow_from
if [ -f /etc/fedora-release ]; then
config_file=/etc/pdns-recursor/recursor.conf
pdns_user=pdns-recursor
elif [ -f /etc/alpine-release ]; then
config_file=/etc/pdns/recursor.conf
pdns_user=recursor
fi
# Create config file from template
envtpl < /recursor.conf.tpl > $config_file
# Fix config file ownership
chown ${pdns_user}: $config_file
exec /usr/sbin/pdns_recursor