File: preinst

package info (click to toggle)
squid 1.1.21-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,828 kB
  • ctags: 3,705
  • sloc: ansic: 34,400; sh: 1,975; perl: 899; makefile: 559
file content (65 lines) | stat: -rw-r--r-- 1,377 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
#! /bin/sh

case "$1" in
	upgrade|install-upgrade)
		;;
	abort-upgrade)
		exit 0
		;;
esac

#
# See if we upgraded from 1.0
#
if [ "$1" = upgrade ] || [ "$1" = install ]
then
	case "$2" in
		1.0*)
			cat <<@EOF

              SQUID 1.1 INSTALLATION WARNING

You are upgrading squid from an 1.0 version to the 1.1 version. The 1.0 and
1.1 versions are NOT compatible. The structure of the cache directory is
different and the configuration file "squid.conf" is not entirely compatible.

If you have an old cache directory, please quit NOW and remove the old cache
by hand (in /var/spool/squid). Then re-install this squid version.

Also, please accept the new configuration file. After upgrading your old
configuration file can be found in "/etc/squid.conf.dpkg-old". Then you have
to edit the new configuration file by hand to match your old configuration.

@EOF
			echo -n "QUIT NOW? [Y/n] "
			read ans
			case "$ans" in
				n*|N*)
					;;
				*)
					exit 1
					;;
			esac
	esac
fi


#
# Add the "proxy" user/group to /etc/passwd if needed.
#

if ! grep -q "^proxy:" /etc/passwd
then
	#
	#	Let's hope that this works; if /var/spool/squid is
	#	already present this fails :(
	#
	adduser --system --home /var/spool/squid --group proxy
	#
	# Change the shell so that cron jobs will work.
	# (They run as root now, but you can never know).
	#
	chsh -s /bin/sh proxy
fi

exit 0