diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-11-11 13:59:18 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-11-11 13:59:18 -0500 |
commit | 2b4ed1d07e5b03f368ccc23e44c2189d5dedc3fd (patch) | |
tree | d6786b027903624576e2f8861a68e665d0fbbb9b /contrib/osx/Tor | |
parent | a29596556c60fbbf687b1af48b9e6646b25f208e (diff) | |
parent | 5beb8ee4e1889346dc9bec5f866b14809a2d6983 (diff) | |
download | tor-2b4ed1d07e5b03f368ccc23e44c2189d5dedc3fd.tar tor-2b4ed1d07e5b03f368ccc23e44c2189d5dedc3fd.tar.gz |
Merge remote branch 'origin/maint-0.2.2'
Conflicts:
configure.in
Diffstat (limited to 'contrib/osx/Tor')
-rwxr-xr-x | contrib/osx/Tor | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/contrib/osx/Tor b/contrib/osx/Tor deleted file mode 100755 index bcddc0c42..000000000 --- a/contrib/osx/Tor +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -TORLOC=/Library/StartupItems/Tor/Tor.loc - -if [ -f $TORLOC ]; then - TORDIR=`cat /Library/StartupItems/Tor/Tor.loc` - if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then - TORDIR=/Library/Tor - fi -else - TORDIR=/Library/Tor -fi -TORCONF=$TORDIR/torrc -TORDATA=$TORDIR/var/lib/tor -TORPID=/var/run/Tor.pid -TORUSER=_tor -TORGROUP=daemon -TORCMD=$TORDIR/tor -TORLOG=/var/log/tor.log - -## Determine OSX Version -# map version to name -if [ -x /usr/bin/sw_vers ]; then -# This is poor, yet functional. We don't care about the 3rd number in -# the OS version - OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2` - case "$OSVER" in - "10.6") ARCH="i386";; - "10.5") ARCH="i386";; - "10.4") ARCH="i386";; - "10.3") ARCH="ppc";; - "10.2") ARCH="ppc";; - "10.1") ARCH="ppc";; - "10.0") ARCH="ppc";; - esac -else - ARCH="unknown" -fi - -if [ $ARCH != "i386" ]; then - export EVENT_NOKQUEUE=1 -fi - -## -# Tor Service -## - -. /etc/rc.common - -StartService () -{ - - if [ -f $TORCMD ]; then - if pid=$(GetPID Tor); then - return 0 - else - ConsoleMessage "Starting Tor Service" -# Tentative -# Making sure it is not running (I know it is not a best approarch) - killall tor 2>/dev/null - $TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" & - fi - fi -} - -StopService () -{ - if pid=$(GetPID Tor); then - ConsoleMessage "Stopping Tor Service" - kill -TERM "${pid}" -# Just for sanity (sometimes necessary.) - killall tor 2>/dev/null - else - ConsoleMessage "Tor Service not responding." -# Just for sanity (sometimes necessary.) - killall tor 2>/dev/null - fi -} - -RestartService () { StopService; StartService; } - -if [ "$#" = 0 ]; then - echo "Syntax: tor {start|stop}" - exit 1 -fi - -RunService "$1" |