aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.h
AgeCommit message (Expand)Author
2016-09-13Refactor the hidden service code to use rend_service_pathteor
2016-09-13Allow the unit tests to pass a service list to rend_service_load_all_keysteor
2016-09-13Implement Prop #260: Single Onion Servicesteor (Tim Wilson-Brown)
2016-09-13Make rend_service_free available to the unit teststeor (Tim Wilson-Brown)
2016-08-24Add a stub for rend_service_allow_direct_connectionteor
2016-05-09Merge branch 'feature15588_squashed'Nick Mathewson
2016-05-09Add client auth to rend_service_add_ephemeralJohn Brooks
2016-05-09
#!/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
 
    r TORPID=/var/run/Tor.pid TORUSER=_tor TORGROUP=daemon TORCMD=$TORDIR/tor TORLOG=/var/log/tor/tor.log ## # 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 [ "x$1" = x ]; then echo "Syntax: tor {start|stop} exit 1 fi RunService "$1"