Fastcgi module for Apache 2.2
[mod_fastcgi.git] / debian / prerm
blobd9b9bcd97c1e95ba001bc52a51420e01954aa86a
1 #!/bin/bash
2 # vim: set ts=2 sw=2 et:
4 set -e
6 # These functions comment out the LoadModule directive in httpd.conf
7 # for apache/apache-ssl. They also ask the user whether to restart
8 # apache/apache-ssl.
9 killconf () {
10 src=/etc/apache/httpd.conf
11 dst=/etc/apache/httpd.conf.tmp.$$
12 if [ -s $src ] ; then
13 sed 's/^\(LoadModule.*mod_fastcgi\.so\)/# \1/' $src > $dst
14 mv -f $dst $src
15 ask_restart
18 killconfssl () {
19 src=/etc/apache-ssl/httpd.conf
20 dst=/etc/apache-ssl/httpd.conf.tmp.$$
21 if [ -s $src ] ; then
22 sed 's/^\(LoadModule.*mod_fastcgi\.so\)/# \1/' $src > $dst
23 mv -f $src $dst
24 ask_restartssl
28 # These functions ask the user whether to restart apache/apachessl.
29 ask_restart () {
30 echo -n "An Apache module has been modified. Restart apache [Y/n]? "
31 read CONFIG
32 if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
33 then
34 if [ -x /usr/sbin/apachectl ]; then
35 /usr/sbin/apachectl restart || true
36 else
37 echo 'apachectl not found.'
41 ask_restartssl () {
42 echo -n "An Apache module has been modified. Restart apache-ssl [Y/n]? "
43 read CONFIG
44 if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ] ; then
45 if [ -x /usr/sbin/apache-sslctl ]; then
46 /usr/sbin/apache-sslctl restart || true
47 else
48 echo 'apache-sslctl not found.'
53 # This script is called twice during the removal of the package; once
54 # after the removal of the package's files from the system, and as
55 # the final step in the removal of this package, after the package's
56 # conffiles have been removed.
58 case "$1" in
59 remove)
60 # This package has been removed, but its configuration has not yet
61 # been purged.
62 killconf
63 killconfssl
66 upgrade | deconfigure | failed-upgrade)
67 # I _think_ I'm right here...let it sit on an upgrade.
71 echo "$0: didn't understand being called with \`$1'" 1>&2
72 exit 1
74 esac
76 exit 0
78 #DEBHELPER#