File: postrm

package info (click to toggle)
libapache-mod-random 1.4-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 92 kB
  • ctags: 59
  • sloc: ansic: 318; makefile: 89; sh: 87
file content (64 lines) | stat: -rw-r--r-- 1,711 bytes parent folder | download
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
#! /bin/sh
# postrm.skeleton
# Skeleton maintainer script showing all the possible cases.
# Written by Charles Briscoe-Smith, March-April 1998.  Public Domain.
# Hacked for libapache-mod-gzip by Ryszard Lach
# Shamelessly copied and then rewritten by Pawel Wiecek

# Abort if any command returns an error value
set -e

# DJ: function to comment us out in httpd.conf
killconf () {
	[ -x /usr/sbin/apache$1 ] || return 0
	if [ -f /etc/apache$1/httpd.conf ]
	then
	  tmpfile=/etc/apache$1/httpd.conf.tmp.$$
	  cat /etc/apache$1/httpd.conf |\
		   sed 's/^(LoadModule.*mod_random\.so)/#\1/' > $tmpfile
	  mv -f $tmpfile /etc/apache$1/httpd.conf
	  ask_restart "$1"
	fi
}

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

# This script is called twice during the removal of the package; once
# after the removal of the package's files from the system, and as
# the final step in the removal of this package, after the package's
# conffiles have been removed.

case "$1" in
  remove)
    # This package has been removed, but its configuration has not yet
    # been purged.
	killconf ""
	killconf "-ssl"
    :
    ;;
  purge | disappear | upgrade | failed-upgrade | abort-upgrade)
    :
    ;;
  abort-install)
    # Back out of an attempt to install this package.  Undo the effects of
    # "preinst install...".  There are two sub-cases.
    killconf ""
    killconf "-ssl"
    :
	;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
     exit 1;;
esac

#DEBHELPER#

exit 0