From: Philip Prindeville Date: Wed, 5 Oct 2022 17:18:33 +0000 (-0600) Subject: isc-dhcp: avoid gratuitous reload of named X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=77d9ed5f6e5d9e49ce42496ae0fc4eb21714d90f;p=feed%2Fpackages.git isc-dhcp: avoid gratuitous reload of named Signed-off-by: Philip Prindeville --- diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index e849a387d4..e72cb37977 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -463,6 +463,12 @@ general_config() { create_empty_zone "$mynet.in-addr.arpa" done + local need_reload= + + cp -p $conf_local_file ${conf_local_file}_ + cmp -s $conf_local_file ${conf_local_file}_ || need_reload=1 + rm -f ${conf_local_file}_ + cat < $conf_local_file zone "$domain" { type master; @@ -488,7 +494,7 @@ zone "$mynet.in-addr.arpa" { EOF done - /etc/init.d/named reload + [ -n "$need_reload" ] && /etc/init.d/named reload sleep 1 cat <