File: apache2.2-common.postrm

package info (click to toggle)
apache2 2.2.16-6%2Bsqueeze15
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 38,516 kB
  • ctags: 20,767
  • sloc: ansic: 227,630; sh: 22,460; perl: 2,191; makefile: 1,244; awk: 1,133; pascal: 517; lex: 191; python: 136; yacc: 100; xml: 36
file content (79 lines) | stat: -rw-r--r-- 1,533 bytes parent folder | download | duplicates (2)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /bin/sh

set -e

# Allow apache 2.4 to override what we do.
if [ -x /etc/apache2/upgrade-to-2.4-in-progress ] ; then
	set +e
	/etc/apache2/upgrade-to-2.4-in-progress $0 "$@"
	ret=$?
	set -e
	case $ret in
	42)
		exit 0
		;;
	43)
		DONT_PURGE=1
		;;
	0)
		: # do nothing
		;;
	*)
		exit $ret
		;;
	esac
fi


if [ "$1" = purge -a "$DONT_PURGE" != 1 ] ; then
	rm -f 	/etc/apache2/httpd.conf \
		/var/cache/apache2/reload \
		/var/log/apache2/access.log* \
		/var/log/apache2/other_vhosts_access.log* \
		/var/log/apache2/error.log*
	
	rm -rf 	/var/cache/apache2/proxy \
		/var/cache/apache2/mod_disk_cache \
		/var/run/apache2 \
		/var/lock/apache2

	for f in /etc/apache2/sites-enabled/* \
		 /etc/apache2/mods-enabled/* ; do
		[ -L "$f" ] && rm -f "$f" 
	done
	
	for d in /etc/apache2/sites-enabled/ \
		/etc/apache2/mods-enabled/ \
		/etc/apache2/conf.d \
		/etc/apache2 \
		/var/log/apache2 \
		/var/cache/apache2 ; do
		rmdir $d 2> /dev/null || true
	done

fi

restore_conffile() {
	if [ -e $1.dpkg-apache2.2-common.old ] ; then
		echo Restoring previous version of $1 ...
		mv $1.dpkg-apache2.2-common.old $1
	fi
}

if [ "$1" = abort-upgrade ] ; then
	restore_conffile /etc/default/apache2
	restore_conffile /etc/apache2/ports.conf
	restore_conffile /etc/apache2/conf.d/charset
fi

if [ "$1" = remove ] ; then
	MD5SUM="`md5sum /var/www/index.html 2>/dev/null | cut -d ' ' -f 1`"
	case "$MD5SUM" in
		5388f60d7695cb57b87c799ee62d20b2|\
		21dde95d9d269cbb2fa6560309dca40c)
			rm -f /var/www/index.html
			;;
	esac
fi

#DEBHELPER#