postinst is in sugarplum 0.9.10-17.2.
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 | #!/bin/sh
# postinst script for sugarplum
# sean finney
set -e
. /usr/share/debconf/confmodule
# this may some day include other web servers
for s in apache apache-ssl apache-perl apache2; do
[ -f "/usr/sbin/$s" ] && all_servers="$all_servers $s"
done
# should we (de)configure for $httpd?
do_conf=""
# get the necessary debconf settings
get_debconf(){
db_get sugarplum/configure_httpd
do_conf="$RET"
}
# reconfigure the web servers
reconfigure_httpd(){
includefile=/etc/sugarplum/apache.conf
for server in $all_servers; do
confdir=/etc/$server/conf.d
conftarget="$confdir/sugarplum.conf"
if [ -d "$confdir" ] && [ ! -e "$conftarget" ]; then
ln -s $includefile "$conftarget"
if [ "$server" != "apache2" ]; then
apache-modconf $server enable mod_rewrite 2>/dev/null || true
else
echo "sugarplum: making sure mod_rewrite is enabled"
a2enmod rewrite
fi
if pgrep -x $server >/dev/null; then
echo "sugarplum: reloading configuration for $server"
invoke-rc.d $server reload || true
fi
fi
done
}
case $1 in
"configure")
get_debconf
if [ "$do_conf" = "true" ]; then
reconfigure_httpd
fi
;;
*) ;;
esac
|