summaryrefslogtreecommitdiff
path: root/community-staging/tor/tor.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-12 00:01:37 +0000
committerroot <root@rshg054.dnsready.net>2012-06-12 00:01:37 +0000
commit14b46fb49966c5beb34127a600e7be2a04d0821b (patch)
tree65525e60fb02fa22c1f3acfd99f60d500606f1f8 /community-staging/tor/tor.install
parent306ac55c1e99cfb5801ef0d9acf2a11d3994d80d (diff)
Tue Jun 12 00:01:37 UTC 2012
Diffstat (limited to 'community-staging/tor/tor.install')
-rw-r--r--community-staging/tor/tor.install24
1 files changed, 24 insertions, 0 deletions
diff --git a/community-staging/tor/tor.install b/community-staging/tor/tor.install
new file mode 100644
index 000000000..2c448d28e
--- /dev/null
+++ b/community-staging/tor/tor.install
@@ -0,0 +1,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
+}