summaryrefslogtreecommitdiff
path: root/debian/trousers.postinst
blob: 47488638b591128501cb1208809b3deeeea4d446 (plain)
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
#!/bin/sh

set -e

case "${1}" in
	configure)
		# Adding tss system user
		adduser --system --quiet --home /var/lib/tpm --shell /bin/false --no-create-home --group tss

		# Setting owner
		chown tss:tss /var/lib/tpm -R
		chown tss:tss /etc/tcsd.conf

		# Setting permissions
		chmod 0600 /etc/tcsd.conf
		chmod 0700 /var/lib/tpm

		# ask udev to check for new udev rules (and fix device permissions)
		[ -x /etc/init.d/udev ] && pidof udevd > /dev/null \
			&& udevadm trigger --sysname-match="tpm[0-9]*"
		;;

	abort-upgrade|abort-remove|abort-deconfigure)

		;;

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

#DEBHELPER#

exit 0