aboutsummaryrefslogtreecommitdiff
path: root/tor/rc.tor.new
diff options
context:
space:
mode:
Diffstat (limited to 'tor/rc.tor.new')
-rwxr-xr-xtor/rc.tor.new20
1 files changed, 20 insertions, 0 deletions
diff --git a/tor/rc.tor.new b/tor/rc.tor.new
new file mode 100755
index 00000000..f90b6d3e
--- /dev/null
+++ b/tor/rc.tor.new
@@ -0,0 +1,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
+