From a1a680e586e9e17f84591b7b83d36e26998792a2 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 16 Sep 2002 10:40:09 +0000 Subject: cfengine: Include files only if the included files exist. --- cfengine/cf.services.dhcp | 14 ++++++++------ cfengine/cf.services.dns | 8 +++++--- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'cfengine') diff --git a/cfengine/cf.services.dhcp b/cfengine/cf.services.dhcp index a4e78d2..695ebf0 100644 --- a/cfengine/cf.services.dhcp +++ b/cfengine/cf.services.dhcp @@ -18,13 +18,15 @@ editfiles: # We don't make the dhcp.conf dynamically, but instead we copy the contents # of a master file, but only if it's newer than the one installed. # - BeginGroupIfFileIsNewer "/etc/local-COMMON/dhcpd.conf.$(site)" - AutoCreate - EmptyEntireFilePlease - InsertFile "/etc/local-COMMON/dhcpd.conf.$(site)" - Append "# Edited by cfengine $(date)" + BeginGroupIfFileExists "/etc/local-COMMON/dhcpd.conf.$(site)" + BeginGroupIfFileIsNewer "/etc/local-COMMON/dhcpd.conf.$(site)" + AutoCreate + EmptyEntireFilePlease + InsertFile "/etc/local-COMMON/dhcpd.conf.$(site)" + Append "# Edited by cfengine $(date)" + EndGroup + DefineClasses "dhcpd_reload" EndGroup - DefineClasses "dhcpd_reload" } processes: diff --git a/cfengine/cf.services.dns b/cfengine/cf.services.dns index ce72883..9bced58 100644 --- a/cfengine/cf.services.dns +++ b/cfengine/cf.services.dns @@ -30,11 +30,13 @@ editfiles: # Append " category statistics { null; };" # EndGroup # - BeginGroupIfNoLineMatching '^include[[:blank:]]"/etc/local-COMMON/bind/named_$(fqhost).conf";.*' + BeginGroupIfFileExists "/etc/local-COMMON/bind/named_$(fqhost).conf" + BeginGroupIfNoLineMatching '^include[[:blank:]]"/etc/local-COMMON/bind/named_$(fqhost).conf";.*' Append 'include "/etc/local-COMMON/bind/named_$(fqhost).conf";' - Append '# EDITED BY CFENGINE $(date)' + Append '# EDITED BY CFENGINE $(date)' + EndGroup + DefineClasses "bind_reload" EndGroup - DefineClasses "bind_reload" } shellcommands: -- cgit v1.2.3