2017-12-11 14:18:10 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# Configure base vars
|
|
|
|
: "${PDNS_local_port:=53}"
|
|
|
|
: "${PDNS_local_address:=0.0.0.0}"
|
|
|
|
|
|
|
|
export PDNS_local_port PDNS_local_address
|
|
|
|
|
|
|
|
# Create config file from template
|
|
|
|
envtpl < /recursor.conf.tpl > /etc/pdns/recursor.conf
|
|
|
|
|
2017-12-27 18:58:53 +01:00
|
|
|
# fix config right
|
2018-10-25 14:51:29 +02:00
|
|
|
if getent passwd | grep -q '^pdns-recursor:'; then
|
2017-12-27 18:58:53 +01:00
|
|
|
# Fedora user
|
|
|
|
chown pdns-recursor:pdns-recursor /etc/pdns/recursor.conf
|
|
|
|
else
|
|
|
|
# Alpine user
|
|
|
|
chown recursor:recursor /etc/pdns/recursor.conf
|
|
|
|
fi
|
|
|
|
|
2017-12-11 14:18:10 +01:00
|
|
|
exec /usr/sbin/pdns_recursor
|