| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | #!/bin/sh## tor    The Onion Router## Startup/shutdown script for tor. This is a wrapper around torctl;# torctl does the actual work in a relatively system-independent, or at least# distribution-independent, way, and this script deals with fitting the# whole thing into the conventions of the particular system at hand.# This particular script is written for Red Hat/Fedora Linux, and may# also work on Mandrake, but not SuSE.## These next couple of lines "declare" tor for the "chkconfig" program,# originally from SGI, used on Red Hat/Fedora and probably elsewhere.## chkconfig: 2345 90 10# description: Onion Router - A low-latency anonymous proxy## Library functionsif [ -f /etc/rc.d/init.d/functions ]; then   . /etc/rc.d/init.d/functionselif [ -f /etc/init.d/functions ]; then   . /etc/init.d/functionsfi# Increase open file descriptors a reasonable amountulimit -n 8192TORCTL=@BINDIR@/torctl# torctl will use these environment variablesTORUSER=@TORUSER@export TORUSERTORGROUP=@TORGROUP@export TORGROUPif [ -x /bin/su ] ; then    SUPROG=/bin/suelif [ -x /sbin/su ] ; then    SUPROG=/sbin/suelif [ -x /usr/bin/su ] ; then    SUPROG=/usr/bin/suelif [ -x /usr/sbin/su ] ; then    SUPROG=/usr/sbin/suelse    SUPROG=/bin/suficase "$1" in    start)    action $"Starting tor:" $TORCTL start    RETVAL=$?    ;;    stop)    action $"Stopping tor:" $TORCTL stop    RETVAL=$?    ;;    restart)    action $"Restarting tor:" $TORCTL restart    RETVAL=$?    ;;    reload)    action $"Reloading tor:" $TORCTL reload    RETVAL=$?    ;;    status)    $TORCTL status    RETVAL=$?    ;;    *)    echo "Usage: $0 (start|stop|restart|reload|status)"    RETVAL=1esacexit $RETVAL
 |