summarylogtreecommitdiffstats
path: root/tor.install
blob: beceb6070419884ed1b609c446c58c9839986338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
post_install() {
  groupadd -g 43 tor &>/dev/null
  useradd -u 43 -g tor -d /var/lib/tor -s /bin/false tor &> /dev/null
  chown tor:tor var/lib/tor &> /dev/null
  chmod 700 var/lib/tor &> /dev/null
}

post_upgrade() {
  getent group tor &>/dev/null || groupadd -g 43 tor &>/dev/null
  getent passwd tor &>/dev/null || useradd -u 43 -g tor -d /var/lib/tor -s /bin/false tor &> /dev/null
  chown tor:tor var/lib/tor &> /dev/null
}

pre_remove() {
  getent passwd tor &>/dev/null && userdel tor &> /dev/null
  getent group tor &>/dev/null && groupdel tor &> /dev/null
}