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