diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2007-05-31 11:32:19 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2007-05-31 11:32:19 +0000 |
commit | 23fbecf15adeb1af173c6ee38e2280dae8f17de0 (patch) | |
tree | 41a9bd41bed21c9f8dc18779d3643ee38ef14209 /debian/sitesummary.postinst | |
parent | d0893f1ffe48d8fbfdf2057fceba3cc0c7407a06 (diff) | |
download | sitesummary-23fbecf15adeb1af173c6ee38e2280dae8f17de0.tar.gz sitesummary-23fbecf15adeb1af173c6ee38e2280dae8f17de0.tar.bz2 sitesummary-23fbecf15adeb1af173c6ee38e2280dae8f17de0.tar.xz |
[ Petter Reinholdtsen ]
* Add code in the server cronjob to generate a replacement
munin.conf, and make it possible to activate it in munin by
setting MUNINDIR=/etc/munin/ in collector.cfg.
* Add preseedable hidden boolean debconf question
sitesummary/replace-munin-config to make it possible to enable
this feature at install time.
* Update the postinst script to make sure the install time code is
only executed during configure.
Diffstat (limited to 'debian/sitesummary.postinst')
-rw-r--r-- | debian/sitesummary.postinst | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/debian/sitesummary.postinst b/debian/sitesummary.postinst index ac8e084..e720788 100644 --- a/debian/sitesummary.postinst +++ b/debian/sitesummary.postinst @@ -2,19 +2,53 @@ set -e -# 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 +# Source debconf library. +. /usr/share/debconf/confmodule -# Make sure the cgi script can write to the storage area -chown www-data /var/lib/sitesummary/tmpstorage /var/lib/sitesummary/entries +case "$1" in + configure) -# Generate the web page at install time -[ -f /var/lib/sitesummary/www/index.html ] || /etc/cron.daily/sitesummary + # 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 + + # Generate the web page at install time + [ -f /var/lib/sitesummary/www/index.html ] || \ + /etc/cron.daily/sitesummary + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac #DEBHELPER# + +exit 0 |