aboutsummaryrefslogtreecommitdiff
path: root/net/misc/tor/rc.tor.new
blob: f90b6d3e23ad3ac3414181f0db1e54fc81b75044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# init script for tor
#

PID="/var/run"
PRIVOXY_PID="$PID/privoxy.pid"
TOR_PID="$PID/tor.pid"
USER="privoxy"

if [ -f $TOR_PID ]; then
  if ps `cat $TOR_PID` | grep -q tor; then
    kill `cat $TOR_PID`
  fi
  rm $TOR_PID
fi

sudo -u $USER /usr/bin/tor &> /dev/null &
echo "$!" > $TOR_PID