summaryrefslogtreecommitdiff
path: root/tor/tor.rc
blob: 41f35f8e6b507f13944a9e7951050389939df4ca (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/tor: start/stop tor daemon
    4 #
    5 
    6 # User settings here
    7 DAEMON=tor
    8 RUN_AS_USER=tor
    9 
   10 # Check for configuration files
   11 [ -f /etc/tor/tor-tsocks.conf ] || exit 1
   12 [ -f /etc/tor/torrc ] || exit 1
   13 
   14 # If you have to edit this section for this or any other 
   15 # port useage let me know, with a patch or added lines, 
   16 # or simplely e-mail me the altered file and I'll include the changes.
   17 
   18 RETVAL=0
   19 
   20 case $1 in
   21 start)
   22 	echo -n "Starting $DAEMON..."
   23 	su $RUN_AS_USER -c /usr/bin/$DAEMON > /dev/null & RETVAL=$?
   24 	if [ $RETVAL = 0 ]; then
   25 		echo " done."
   26 	fi
   27 	;;
   28 stop)
   29 	echo -n "Shutting down $DAEMON..."
   30 	killall -q /usr/bin/$DAEMON
   31 	RETVAL=$?
   32 	echo " done."
   33 	;;
   34 restart)
   35 	$0 stop
   36 	sleep 5
   37 	$0 start
   38 	RETVAL=$?
   39 	;;
   40 *)
   41 	echo "usage: $0 [start|stop|restart]"
   42 	exit 1
   43 	;;
   44 esac
   45 
   46 exit $RETVAL
   47 
   48 # End of file

Generated by cgit