5 # Startup/shutdown script for tor. This is a wrapper around torctl;
6 # torctl does the actual work in a relatively system-independent, or at least
7 # distribution-independent, way, and this script deals with fitting the
8 # whole thing into the conventions of the particular system at hand.
9 # This particular script is written for Red Hat/Fedora Linux, and may
10 # also work on Mandrake, but not SuSE.
12 # These next couple of lines "declare" tor for the "chkconfig" program,
13 # originally from SGI, used on Red Hat/Fedora and probably elsewhere.
15 # chkconfig: 2345 90 10
16 # description: Onion Router - A low-latency anonymous proxy
20 if [ -f /etc
/rc.d
/init.d
/functions
]; then
21 .
/etc
/rc.d
/init.d
/functions
22 elif [ -f /etc
/init.d
/functions
]; then
23 .
/etc
/init.d
/functions
26 # Increase open file descriptors a reasonable amount
29 TORCTL
=@BINDIR@
/torctl
31 # torctl will use these environment variables
35 if [ -x /bin
/su
] ; then
37 elif [ -x /sbin
/su
] ; then
39 elif [ -x /usr
/bin
/su
] ; then
41 elif [ -x /usr
/sbin
/su
] ; then
50 action $
"Starting tor:" $TORCTL start
55 action $
"Stopping tor:" $TORCTL stop
60 action $
"Restarting tor:" $TORCTL restart
65 action $
"Reloading tor:" $TORCTL reload
75 echo "Usage: $0 (start|stop|restart|reload|status)"