[svn-inject] Applying Debian modifications to trunk
[manu/mod-proxy-html.git] / debian / postinst
1 #! /bin/sh
2 # postinst script for libapache2-mod-proxy-html
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 #        * <postinst> `configure' <most-recently-configured-version>
10 #        * <old-postinst> `abort-upgrade' <new version>
11 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12 #          <new-version>
13 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
14 #          <failed-install-package> <version> `removing'
15 #          <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
18 #
19
20 reload_apache()
21 {
22     if apache2ctl configtest 2>/dev/null; then
23         invoke-rc.d apache2 force-reload || true
24     else
25         echo "Your apache2 configuration is broken, so we're not restarting it for you."
26     fi
27 }
28
29
30 case "$1" in
31     configure)
32         # Reload the module on upgrade if enabled
33         if [ -n "$2" ]; then
34             if [ -e /etc/apache2/mods-enabled/proxy_html.load ]; then
35                 reload_apache
36             fi
37         else 
38             # Enable the module
39             if [ -e /etc/apache2/apache2.conf ]; then
40                 a2enmod proxy_html >/dev/null || true
41                 reload_apache
42             fi
43         fi
44     ;;
45
46     abort-upgrade|abort-remove|abort-deconfigure)
47
48     ;;
49
50     *)
51         echo "postinst called with unknown argument \`$1'" >&2
52         exit 1
53     ;;
54 esac
55
56 # dh_installdeb will replace this with shell code automatically
57 # generated by other debhelper scripts.
58
59 #DEBHELPER#
60
61 exit 0
62
63