4 TORPID
=@LOCALSTATEDIR@
/run
/tor.pid
5 TORLOG
=@LOCALSTATEDIR@
/log
/tor
/tor.log
6 TORCONF
=@CONFDIR@
/torrc
13 if [ -f $TORPID ]; then
14 echo "tor appears to be already running (pid file exists)"
15 echo "Maybe you should run: $0 restart ?"
18 echo -n "Starting tor..."
19 $TORBIN -f $TORCONF $TORARGS >$TORLOG 2>&1 &
21 if [ $RETVAL -eq 0 ]; then
30 if [ -f $TORPID ]; then
31 echo -n "Killing tor..."
34 if [ $RETVAL -eq 0 ]; then
40 echo "Unable to kill tor: $TORPID does not exist"
47 if [ -f $TORPID ]; then
54 PID
=`cat $TORPID 2>/dev/null`
55 if [ "$PID" != "" ]; then
56 torstat
=`ps -p $PID | grep -c "^$PID"`
58 echo "tor is running ($PID)"
60 echo "tor is not running (looks like it crashed, look for core? $PID)"
63 echo "tor is not running (exited gracefully)"
72 echo "Usage: $0 (start|stop|restart|status|log)"