From 10b0129f4ecd8457c9f6e62f0a3bf7b8aaf5c6cf Mon Sep 17 00:00:00 2001 From: Erik Hanson Date: Wed, 12 May 2010 17:44:17 +0200 Subject: network/tor: Updated for version 0.2.0.35 --- network/tor/rc.tor | 75 +++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'network/tor/rc.tor') diff --git a/network/tor/rc.tor b/network/tor/rc.tor index d7ef906aae..cdeb865af3 100644 --- a/network/tor/rc.tor +++ b/network/tor/rc.tor @@ -1,43 +1,42 @@ - #!/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 script is a modified contrb/tor.sh, for use on Slackware. + +TORCTL=/usr/bin/torctl -PIDFILE="/var/lib/tor/tor.pid" - -tor_start() { - echo -n "Starting tor: " - if [ ! -f $PIDFILE ]; then - /usr/bin/tor 1> /dev/null - echo "OK" - else - echo -n "Removing stale lock.. " - rm -f $PIDFILE - /usr/bin/tor 1> /dev/null - echo "OK" - fi -} - -tor_stop() { - echo -n "Stopping tor: " - if [ -f $PIDFILE ]; then - killall tor &> /dev/null - rm -f $PIDFILE - echo "OK" - else - echo "Not Running" - fi -} +# torctl will use these environment variables +TORUSER=tor +export TORUSER case "$1" in - start) - tor_start - ;; - stop) - tor_stop - ;; - restart) - tor_stop - tor_start - ;; - *) - echo "Usage: rc.tor {start|stop|restart}" + + start) + $TORCTL start + ;; + + stop) + $TORCTL stop + ;; + + restart) + $TORCTL restart + ;; + + reload) + $TORCTL reload + ;; + + status) + $TORCTL status + ;; + + *) + echo "Usage: $0 (start|stop|restart|reload|status)" esac -- cgit v1.2.3-65-gdbad