File: squid.preinst

package info (click to toggle)
squid 7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,388 kB
  • sloc: cpp: 184,632; ansic: 12,437; sh: 5,688; makefile: 5,245; perl: 2,560; sql: 326; python: 240; awk: 141; sed: 1
file content (43 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (6)
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
#! /bin/sh

set -e

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

if ! getent passwd proxy
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

disable_profile() {
    APP_CONFFILE="/etc/apparmor.d/usr.sbin.squid"
    APP_DISABLE="/etc/apparmor.d/disable/usr.sbin.squid"
    # Create a symlink to the yet-to-be-unpacked profile
    if [ ! -e "$APP_CONFFILE" ]; then
        mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
        ln -sf $APP_CONFFILE $APP_DISABLE
    fi
}

if [ "$1" = "install" ]; then
    # Disable AppArmor profile on install
    disable_profile
fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0