|
@ -2,27 +2,25 @@ |
|
|
|
|
|
|
|
|
mkdir -p /etc/powerdns/pdns.d |
|
|
mkdir -p /etc/powerdns/pdns.d |
|
|
|
|
|
|
|
|
cat >/etc/powerdns/pdns.conf <<EOF |
|
|
PDNSVARS=`echo ${!PDNS_*}` |
|
|
# MySQL Configuration |
|
|
touch /etc/powerdns/pdns.conf |
|
|
# |
|
|
|
|
|
# Launch gmysql backend |
|
|
for var in $PDNSVARS; do |
|
|
launch=gmysql |
|
|
varname=`echo ${var#"PDNS_"} | awk '{print tolower($0)}' | sed 's/_/-/g'` |
|
|
# gpgsql parameters |
|
|
value=`echo ${!var} | sed 's/^$\(.*\)/\1/'` |
|
|
gmysql-host=mysql |
|
|
if [ ! -z ${!value} ]; then |
|
|
gmysql-user=$MYSQL_ENV_MYSQL_USER |
|
|
echo "$varname=${!value}" >> /etc/powerdns/pdns.conf |
|
|
gmysql-dbname=$MYSQL_ENV_MYSQL_DATABASE |
|
|
else |
|
|
gmysql-password=$MYSQL_ENV_MYSQL_PASSWORD |
|
|
echo "$varname=$value" >> /etc/powerdns/pdns.conf |
|
|
gmysql-dnssec=$DNSSEC |
|
|
fi |
|
|
include-dir=/etc/powerdns/pdns.d |
|
|
done |
|
|
EOF |
|
|
|
|
|
|
|
|
|
|
|
if [ ! -z $APIKEY ]; then |
|
|
if [ ! -z $PDNS_EXPERIMENTAL_API_KEY ]; then |
|
|
cat >/etc/powerdns/pdns.d/api.conf <<EOF |
|
|
cat >/etc/powerdns/pdns.d/api.conf <<EOF |
|
|
experimental-json-interface=yes |
|
|
experimental-json-interface=yes |
|
|
webserver=yes |
|
|
webserver=yes |
|
|
webserver-address=0.0.0.0 |
|
|
webserver-address=0.0.0.0 |
|
|
webserver-allow-from=0.0.0.0/0 |
|
|
webserver-allow-from=0.0.0.0/0 |
|
|
experimental-api-key=$APIKEY |
|
|
|
|
|
EOF |
|
|
EOF |
|
|
|
|
|
|
|
|
fi |
|
|
fi |
|
|