This file is indexed.

postinst is in sitesummary 0.1.33.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule

test_nagios() {
    if grep -q '^NAGIOSCFG="/etc/icinga/sitesummary.cfg"$' "$config"; then
	:
    else
	db_get sitesummary/enable-nagios-config
	if [ true = "$RET" ] ; then
	    mkdir -p $(dirname $config)
	    echo 'NAGIOSCFG="/etc/icinga/sitesummary.cfg"' \
		>> /etc/default/icinga
	    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 <<EOF
define host {
        use       server-host
        host_name localhost
        address   localhost
}

define service {
        use       server-service
        host_name localhost
        service_description ping
        check_command       check_ping!100.0,20%!500.0,60%
}
EOF
	    fi
	fi
    fi
}

# Automatically added by dh_installdeb/11.1.4ubuntu1
dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/sitesummary /etc/apache2/conf-available/sitesummary.conf 0.1.10 -- "$@"
# End automatically added section


case "$1" in
    configure)
        # 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
		mkdir -p /etc/sitesummary
		echo 'MUNINDIR=/etc/munin' > $config
	    fi
	fi

	config=/etc/default/icinga
	if [ -f "$config" ] ; then
	    test_nagios
	fi

        # Generate the web page at install time
	[ -f /var/lib/sitesummary/www/index.html ] || \
	    /etc/cron.daily/sitesummary

	# Get rid of incorrect runlevel settings during upgrades
	if dpkg --compare-versions "$2" lt "0.0.50"; then
		update-rc.d -f sitesummary-client remove >/dev/null 2>&1 || :
	fi

        # Close debconf file handles before restarting Apache
        db_stop

        # Enable it on fresh installations as before Apache 2.4.  Check for
        # cgi.load existence to avoid trying to configure when installed after
        # apache2 is unpacked but not yet configured (bug #760084).
        if [ -z "$2" ] && \
            [ -e /etc/apache2/mods-available/cgi.load ] && \
            [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
            . /usr/share/apache2/apache2-maintscript-helper
            apache2_invoke enmod cgi.load
            apache2_invoke enconf sitesummary.conf
        fi

        # Make sure the cgi script can write to the storage area
	chown www-data /var/lib/sitesummary/tmpstorage \
	    /var/lib/sitesummary/entries

	;;

  triggered)

        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
            . /usr/share/apache2/apache2-maintscript-helper
            apache2_invoke enmod cgi.load
            apache2_invoke enconf sitesummary.conf
        fi

        ;;

    abort-upgrade|abort-remove|abort-deconfigure)

	;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

exit 0