#!/bin/sh set -e # Source debconf library. . /usr/share/debconf/confmodule case "$1" in configure) # Adjust to the new config location, in # /etc/apache2/conf.d/sitesummary if [ -f /etc/apache2/sites-available/sitesummary ] ; then if [ -f /etc/apache2/sites-enabled//sitesummary ] && [ -x /usr/sbin/a2dissite ] ; then a2dissite sitesummary fi rm /etc/apache2/sites-available/sitesummary fi # Make sure the cgi script can write to the storage area chown www-data /var/lib/sitesummary/tmpstorage \ /var/lib/sitesummary/entries # If the config file is missing, check debconf to see if the # munin configuration feature should be enabled. This hidden # debconf question allow preseeding during installation. config=/etc/sitesummary/collector.cfg if [ ! -f $config ] ; then db_get sitesummary/replace-munin-config if [ true = "$RET" ] ; then echo 'MUNINDIR=/etc/munin' > $config fi fi config=/etc/default/nagios3 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 </dev/null 2>&1 || : fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0