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 <philipp@redfish-solutions.com>
This commit is contained in:
parent
671594bec2
commit
90de55b6bb
1 changed files with 3 additions and 2 deletions
|
@ -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 <<EOF > $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
|
||||
|
||||
|
|
Loading…
Reference in a new issue