From e8a5670122e04574fdb5855ecd63d18f317c5bfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20Henriques?= Date: Sun, 18 Apr 2021 23:41:30 +0100 Subject: [PATCH] dnsmasq: add ignore hosts dir to dnsmasq init script MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- package/network/services/dnsmasq/files/dnsmasq.init | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 680e72f9e7..44e7d2d4f9 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -1012,7 +1012,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" -- 2.30.2