diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-19 19:50:02 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-19 19:50:02 +0000 |
commit | 8da44c7b9d9a56e2a40e0e193837e03b4835337b (patch) | |
tree | cb511077c4b7b03d3f95d0c79c23a6c7a6bf3145 /debian/sitesummary.cron.daily | |
parent | acf749106422d6ee83599d833df7d60d439a05bb (diff) | |
download | sitesummary-8da44c7b9d9a56e2a40e0e193837e03b4835337b.tar.gz sitesummary-8da44c7b9d9a56e2a40e0e193837e03b4835337b.tar.bz2 sitesummary-8da44c7b9d9a56e2a40e0e193837e03b4835337b.tar.xz |
Make sure to not replace the existing generated nagios config with
a empty file if no entries have been submitted.
Diffstat (limited to 'debian/sitesummary.cron.daily')
-rwxr-xr-x | debian/sitesummary.cron.daily | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/debian/sitesummary.cron.daily b/debian/sitesummary.cron.daily index 8ed0f01..ae74ba3 100755 --- a/debian/sitesummary.cron.daily +++ b/debian/sitesummary.cron.daily @@ -85,7 +85,9 @@ generate_nagios_config() { true ) > $NAGIOSDIR/nagios-generated.cfg.new && \ chmod a+r $NAGIOSDIR/nagios-generated.cfg.new - if cmp -s $NAGIOSDIR/nagios-generated.cfg.new $NAGIOSDIR/nagios-generated.cfg + if [ ! -s $NAGIOSDIR/nagios-generated.cfg.new ] || \ + cmp -s $NAGIOSDIR/nagios-generated.cfg.new \ + $NAGIOSDIR/nagios-generated.cfg then rm $NAGIOSDIR/nagios-generated.cfg.new false |