3 TORLOC
=/Library
/StartupItems
/Tor
/Tor.loc
5 if [ -f $TORLOC ]; then
6 TORDIR
=`cat /Library/StartupItems/Tor/Tor.loc`
7 if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor
]; then
14 TORDATA
=$TORDIR/var
/lib
/tor
15 TORPID
=/var
/run
/Tor.pid
19 TORLOG
=/var
/log
/tor
/tor.log
30 if [ -f $TORCMD ]; then
31 if pid
=$
(GetPID Tor
); then
34 ConsoleMessage
"Starting Tor Service"
36 # Making sure it is not running (I know it is not a best approarch)
37 killall tor
2>/dev
/null
38 $TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" &
45 if pid
=$
(GetPID Tor
); then
46 ConsoleMessage
"Stopping Tor Service"
48 # Just for sanity (sometimes necessary.)
49 killall tor
2>/dev
/null
51 ConsoleMessage
"Tor Service not responding."
52 # Just for sanity (sometimes necessary.)
53 killall tor
2>/dev
/null
57 RestartService
() { StopService
; StartService
; }
60 echo "Syntax: tor {start|stop}"