summaryrefslogtreecommitdiff
path: root/community-testing/tor/tor.install
blob: 2c448d28e7ef7dbcdf3799c43c76dbc0b8f62488 (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
post_install() {
  echo "-> Tor has been preconfigured to run as a client only."
  echo "-> Tor is experimental software. Do not rely on it for strong anonymity."
  echo '-> '
  echo '-> You can set custom file descriptor ulimits for Tor in'
  echo '-> "/etc/conf.d/tor" using the "TOR_MAX_FD" variable.'
  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() {
  echo '-> You can now set custom file descriptor ulimits for Tor in'
  echo '-> "/etc/conf.d/tor" using the "TOR_MAX_FD" variable.'
  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
}