diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-09-16 10:40:09 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-09-16 10:40:09 +0000 |
commit | a1a680e586e9e17f84591b7b83d36e26998792a2 (patch) | |
tree | 1fd4f32573f0ac35908691a382a55acff5d2ac71 | |
parent | 97a66b9430090020ffa63ea534422c0fad44cf47 (diff) |
cfengine: Include files only if the included files exist.
-rw-r--r-- | cfengine/cf.services.dhcp | 14 | ||||
-rw-r--r-- | cfengine/cf.services.dns | 8 |
2 files changed, 13 insertions, 9 deletions
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: |