postinst is in colplot 5.0.1-3.
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 | #!/bin/sh
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0
#
# Skip, if we are not in "configure" or "reconfigure" state
#
if [ "$1" != "configure" ] && [ "$1" != "reconfigure" ]; then
exit 0
fi
#
# retrieve various configuration options from debconf
#
db_get colplot/webserver
WWWTYPE="$RET"
# done with debconf...
db_stop
# Only create link and grant permissions on first install
if [ ! -n "$2" ] ; then
chown -R www-data:www-data /usr/share/colplot/site
ln -sf /usr/bin/colplot /usr/share/colplot/site/index.cgi
fi
# Update the webserver, if needed
case $WWWTYPE in
apache2)
if [ -e /etc/apache2/conf-available/colplot.conf ] ; then
ucf --debconf-ok /usr/share/colplot/conf_templates/colplot.apache.conf /etc/apache2/conf-available/colplot.conf
ucfr colplot /etc/apache2/conf-available/colplot.conf
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf colplot
else
echo "Apache2 not installed, skipping"
fi
else
echo "Apache2 not installed, skipping"
fi
;;
lighttpd)
ucf --debconf-ok /usr/share/colplot/conf_templates/colplot.lighttpd.conf /etc/lighttpd/conf-available/20-colplot.conf
ucfr colplot /etc/lighttpd/conf-available/20-colplot.conf
if [ -e /etc/lighttpd/conf-available/20-colplot.conf ] ; then
if which lighty-enable-mod >/dev/null 2>&1 ; then
lighty-enable-mod colplot || \
if [ "$?" != "2" ] ; then exit 1 ; else true ; fi
else
echo "Lighttpd not installed, skipping"
fi
fi
;;
*)
;;
esac
# Always trigger reload of webservers if the configuration is enabled
if [ -e /etc/apache2/conf.d/colplot.conf -o -e /etc/apache2/conf-enabled/colplot.conf ] ; then
invoke-rc.d apache2 reload || true
fi
if [ -e /etc/lighttpd/conf-enabled/20-colplot.conf ] ; then
invoke-rc.d lighttpd reload 3>/dev/null || true
fi
exit 0
|