From 90de55b6bb02430b3734428339aee1685f8cc05d Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Tue, 8 Nov 2022 20:24:41 -0700 Subject: [PATCH] isc-dhcp: Fix logic to detect if the config file is unchanged Thanks for Jaymin Patel for pointing the broken logic out. Signed-off-by: Philip Prindeville --- net/isc-dhcp/files/dhcpd.init | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index e72cb37977..94bdfea874 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -466,8 +466,6 @@ general_config() { 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" { @@ -494,6 +492,9 @@ zone "$mynet.in-addr.arpa" { EOF done + cmp -s $conf_local_file ${conf_local_file}_ || need_reload=1 + rm -f ${conf_local_file}_ + [ -n "$need_reload" ] && /etc/init.d/named reload sleep 1 -- 2.30.2