2019-03-01 22:49:31 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
if [ -z ${PDNS_API_KEY+x} ]; then
|
|
|
|
API_KEY=changeme
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z ${PDNS_PORT+x} ]; then
|
|
|
|
WEB_PORT=8081
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Import schema structure
|
|
|
|
if [ -e "/data/pdns.sql" ]; then
|
2022-12-22 21:47:02 +00:00
|
|
|
rm -f /data/pdns.db
|
2019-03-01 22:49:31 +00:00
|
|
|
cat /data/pdns.sql | sqlite3 /data/pdns.db
|
2022-12-22 21:47:02 +00:00
|
|
|
rm -f /data/pdns.sql
|
2019-03-01 22:49:31 +00:00
|
|
|
echo "Imported schema structure"
|
|
|
|
fi
|
|
|
|
|
|
|
|
chown -R pdns:pdns /data/
|
|
|
|
|
|
|
|
/usr/sbin/pdns_server \
|
|
|
|
--launch=gsqlite3 --gsqlite3-database=/data/pdns.db \
|
|
|
|
--webserver=yes --webserver-address=0.0.0.0 --webserver-port=${PDNS_PORT} \
|
|
|
|
--api=yes --api-key=$PDNS_API_KEY --webserver-allow-from=${PDNS_WEBSERVER_ALLOW_FROM}
|