isc-dhcp: avoid gratuitous reload of named 19532/head
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 5 Oct 2022 17:18:33 +0000 (11:18 -0600)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 5 Oct 2022 17:19:37 +0000 (11:19 -0600)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/isc-dhcp/files/dhcpd.init

index e849a387d4820eda27f21692001092c34d289422..e72cb3797704d0d1dff25839b9365a1a65c3870a 100755 (executable)
@@ -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 <<EOF > $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 <<EOF