From be7419d972d8ba82e95f35d35e547b67468bc704 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Tue, 26 Jan 2010 22:15:33 +0000 Subject: Adjust sitesummary postinst to only try to enable nagios autoconfig if /etc/default/nagios3 exist. --- debian/changelog | 2 ++ debian/sitesummary.postinst | 48 +++++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 21 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 82eb561..701cffb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ sitesummary (0.0.59) UNRELEASED; urgency=low Petter Reinholdtsen. * Introduce new agesinceseen group 120-180 to have one limit that match the removal limit (120 days). + * Adjust sitesummary postinst to only try to enable nagios + autoconfig if /etc/default/nagios3 exist. -- Petter Reinholdtsen Tue, 26 Jan 2010 08:56:53 +0100 diff --git a/debian/sitesummary.postinst b/debian/sitesummary.postinst index d828ab7..6362027 100644 --- a/debian/sitesummary.postinst +++ b/debian/sitesummary.postinst @@ -5,6 +5,31 @@ set -e # Source debconf library. . /usr/share/debconf/confmodule +test_nagios() { + if grep -q '^NAGIOSCFG="/etc/nagios3/sitesummary.cfg"$' "$config"; then + : + else + db_get sitesummary/enable-nagios-config + if [ true = "$RET" ] ; then + mkdir -p $(dirname $config) + echo 'NAGIOSCFG="/etc/nagios3/sitesummary.cfg"' \ + >> /etc/default/nagios3 + if [ ! -f /var/lib/sitesummary/nagios-generated.cfg ] ; then + # Create dummy file to make sure nagios will start + # on first boot if sitesummary is installed using + # debian-installer + cat > /var/lib/sitesummary/nagios-generated.cfg <> /etc/default/nagios3 - if [ ! -f /var/lib/sitesummary/nagios-generated.cfg ] ; then - # Create dummy file to make sure nagios will start - # on first boot if sitesummary is installed using - # debian-installer - cat > /var/lib/sitesummary/nagios-generated.cfg <