Files
compose/dnsmasq/docker-bootstrap.sh
2025-05-25 15:41:04 +08:00

24 lines
323 B
Bash
Executable File

#!/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 "$@"