aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init14
2 files changed, 14 insertions, 2 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 307b4defe7..5b1073fc2c 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_VERSION:=2.77
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 62a3169c67..2d05b77873 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -89,6 +89,16 @@ log_once() {
logger -t dnsmasq "$@"
}
+has_handler() {
+ local file
+
+ for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do
+ [ -f "$file" ] && return 0
+ done
+
+ return 1
+}
+
append_bool() {
local section="$1"
local option="$2"
@@ -832,8 +842,10 @@ dnsmasq_start()
config_get_bool readethers "$cfg" readethers
[ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
- xappend "--dhcp-script=$DHCPSCRIPT"
config_get user_dhcpscript $cfg dhcpscript
+ if has_handler || [ -n "$user_dhcpscript" ]; then
+ xappend "--dhcp-script=$DHCPSCRIPT"
+ fi
config_get leasefile $cfg leasefile "/tmp/dhcp.leases"
[ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"