File: prerm

package info (click to toggle)
libapache-mod-perl 1.21.20000309-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,632 kB
  • ctags: 1,295
  • sloc: perl: 7,049; ansic: 5,214; sh: 356; makefile: 171
file content (39 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -e

#DEBHELPER#

# DJ: function to comment us out in httpd.conf
killconf () {
	if [ -f /etc/apache/httpd.conf ]; then
		tmpfile=/etc/apache/httpd.conf.tmp.$$
		cat /etc/apache/httpd.conf |\
			 sed 's/^(LoadModule.*mod_perl\.so)/#\1/' > $tmpfile
		mv -f $tmpfile /etc/apache/httpd.conf
		# Let the user restart when they want to.
		# ask_restart
	fi
}

# Restart apache if user wants.
ask_restart () {
	echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
	read CONFIG || true
	if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
	then
		test -x /usr/sbin/apachectl && /usr/sbin/apachectl restart || true
	fi
}

case "$1" in
  remove)
	killconf ;;
  upgrade | deconfigure | failed-upgrade)
	:
	;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
     exit 1;;
esac

exit 0