nmap: remove empty folder
[openwrt.org/packages.git] / net / tor.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
3
4 START=50
5 STOP=50
6
7 USE_PROCD=1
8
9 start_service() {
10 user_exists tor 52 || user_add tor 52 52 /var/lib/tor
11 group_exists tor 52 || group_add tor 52
12 [ -f /var/run/tor.pid ] || {
13 touch /var/run/tor.pid
14 chown tor:tor /var/run/tor.pid
15 }
16 [ -d /var/lib/tor ] || {
17 mkdir -m 0755 -p /var/lib/tor
18 chmod 0700 /var/lib/tor
19 chown tor:tor /var/lib/tor
20 }
21 [ -d /var/log/tor ] || {
22 mkdir -m 0755 -p /var/log/tor
23 chown tor:tor /var/log/tor
24 }
25 procd_open_instance
26 procd_set_param command /usr/sbin/tor --runasdaemon 0
27 procd_close_instance
28 }
29
comments