dnsmasq: add ignore hosts dir to dnsmasq init script

When running multiple instances of dnsmasq, for example one being for the lan
and another for a guest network, it might not be desirable to have the same dns names
configured in both networks

Signed-off-by: João Henriques <joaoh88@gmail.com>
(cherry picked from commit e8a5670122)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
João Henriques 2021-04-18 23:41:30 +01:00 committed by Daniel Golle
parent 9531e70708
commit da5fd91073
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA

View File

@ -1020,7 +1020,12 @@ dnsmasq_start()
xappend "--dhcp-broadcast=tag:needs-broadcast"
xappend "--addn-hosts=$(dirname $HOSTFILE)"
config_get_bool ignore_hosts_dir "$cfg" ignore_hosts_dir 0
if [ "$ignore_hosts_dir" = "1" ]; then
xappend "--addn-hosts=$HOSTFILE"
else
xappend "--addn-hosts=$(dirname $HOSTFILE)"
fi
config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d"
xappend "--conf-dir=$dnsmasqconfdir"