This file is indexed.

preinst is in bacula-common 5.2.5-0ubuntu6.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
#! /bin/bash
# preinst script for bacula
#

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


create_bacula_do_not_run()
{
	if [ "$1" = "install" -a "$#" -eq 1 ]; then
		test -d /etc/bacula || mkdir -p /etc/bacula

		cat > /etc/bacula/do_not_run <<EOF
If this file exists as /etc/bacula/do_not_run, none of the Bacula daemons
will start. 
This is to allow you time to configure things before Bacula tries to 
do anything.

To make Bacula start, rename or remove this file.
EOF

	fi

}


#if [ "$1" = "install" -a "$#" -eq 1 ]; then
#	create_bacula_do_not_run()
#fi


case "$1" in

	install)
		if ! getent passwd bacula >/dev/null; then
			echo -n "Adding user 'bacula'... "
			adduser --system --no-create-home --group bacula 2>&1 > /dev/null
			usermod -c "Bacula" bacula
			usermod -G tape bacula
			echo "Ok."
                        usermod -d /var/lib/bacula bacula
		fi
	;;

	upgrade)
               # Before 1.38.9-2, logs were in the wrong place.  Fix.
               if dpkg --compare-versions "$2" lt 1.38.9-2 && 
                   test -h /var/log/bacula/log &&
                   test -f /var/lib/bacula/log; then
                   rm /var/log/bacula/log
                   mv /var/lib/bacula/log /var/log/bacula/log
               fi
	;;

	abort-upgrade)
	;;

	*)
		echo "preinst called with unknown argument \`$1'" >&2
		exit 1
	;;
esac

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



exit 0