2018-03-04 12:41:25 +00:00
|
|
|
#!/usr/local/bin/dumb-init /bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
2019-01-12 16:09:07 +00:00
|
|
|
# Ensure default config without zones
|
|
|
|
[ -e /src/zones/named.conf ] || {
|
|
|
|
cp /src/named.conf.default /src/zones/named.conf
|
|
|
|
}
|
2018-03-04 12:41:25 +00:00
|
|
|
|
2019-01-12 16:09:07 +00:00
|
|
|
if [ "${1:-}" = 'named' ]; then
|
|
|
|
# Generate rndc communication key
|
|
|
|
rndc-confgen -a
|
2019-12-23 21:34:02 +00:00
|
|
|
chmod 0644 /etc/bind/rndc.key
|
2019-01-12 16:09:07 +00:00
|
|
|
|
|
|
|
# Start crond in the background
|
|
|
|
crond
|
|
|
|
|
|
|
|
# Start coredns
|
|
|
|
exec "$@"
|
2018-03-04 12:41:25 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
exec "$@"
|