summarylogtreecommitdiffstats
path: root/trousers.install
blob: eddfd28e564dbe136642a855d3a8147f26810d12 (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
post_install() {
  groupadd -r tss

  useradd -r -g tss -d /var/lib/tpm -s /bin/false tss
  chown -R tss:tss /var/lib/tpm
  chown tss:tss /usr/bin/tcsd

  chown tss:tss /etc/tcsd.conf
  chmod 0600 /etc/tcsd.conf

  udevadm trigger --sysname-match="tpm[0-9]*"
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  /etc/rc.d/tcsd stop &> /dev/null
  systemctl stop tcsd
  userdel tss
}

op=$1
shift
$op $*