compose/dnsmasq/docker-bootstrap.sh
2024-12-29 10:10:22 +08:00

24 lines
323 B
Bash

#!/usr/bin/env sh
set -e
DEFAULT_CONFIG=$(cat <<-EOF
no-hosts
no-resolv
conf-dir=/etc/dnsmasq.d/
log-queries
log-facility=/var/log/dnsmasq/dnsmasq.log
EOF
)
CONFIG_CONTENT=${CONFIG:-$DEFAULT_CONFIG}
printf "%s" "$CONFIG_CONTENT\n" >/etc/dnsmasq.conf
if [ "$1" = "dnsmasq" ]; then
shift
fi
/usr/bin/dnsmasq -k "$@"