File: amanda-common.postinst

package info (click to toggle)
amanda 1:3.5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 30,724 kB
  • sloc: ansic: 265,630; perl: 114,269; xml: 16,058; sh: 8,667; makefile: 2,795; awk: 502; lex: 407; yacc: 347; javascript: 135; tcl: 118; sql: 19; sed: 16; php: 2
file content (64 lines) | stat: -rw-r--r-- 1,632 bytes parent folder | download | duplicates (3)
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
set -e

. /usr/share/debconf/confmodule

if [ "$1" = configure ]; then
	if ! getent passwd backup; then
		adduser --quiet --system --no-create-home --home /var/backups \
			--shell /bin/sh --uid 34 --gid 34 backup
	fi

	if [ ! -f /var/backups/.profile ]; then
		echo 'PATH="$PATH:/usr/sbin"' > /var/backups/.profile
	fi

	groupadd -f -g 34 backup
	groupadd -f -g 26 tape

	adduser backup disk
	adduser backup tape

	# in case we get installed first
	if [ ! -d /var/lib/amanda ]; then
		mkdir -p /var/lib/amanda
	fi

	# try to handle a /var/lib/amandates file, since we created it
	# incorrectly in previous versions of the amanda packages for Debian
	if [ -f /var/lib/amandates ]; then
  		if [ ! -f /var/lib/amanda/amandates ]; then
    			mv /var/lib/amandates /var/lib/amanda/amandates
  		fi
	fi

	# make sure amandates exists and has the right perms
	if [ ! -f /var/lib/amanda/amandates ]; then
		touch /var/lib/amanda/amandates
	fi
	chown backup:backup /var/lib/amanda/amandates

	# make sure user backup has a home directory
	if [ ! -d ~backup ]; then
		mkdir -p ~backup
	fi

	# make sure there is a .amandahosts symlink
	if [ ! -L ~backup/.amandahosts ]; then
  		ln -sf /etc/amandahosts ~backup/.amandahosts
	fi

	# make sure /var/log/amanda exists
	if [ ! -d /var/log/amanda ]; then
		mkdir -p /var/log/amanda
	fi

	chown backup:backup ~backup/.amandahosts /etc/amandahosts \
		/var/log/amanda
	chmod 600 ~backup/.amandahosts /etc/amandahosts
	chmod 770 /var/log/amanda
fi

update-inetd --add "amanda stream tcp nowait backup /usr/lib/amanda/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped"

#DEBHELPER#