summaryrefslogtreecommitdiffstats
path: root/network/tor/rc.tor
diff options
context:
space:
mode:
author Erik Hanson <erik@slackbuilds.org>2010-05-12 17:44:17 +0200
committer Robby Workman <rworkman@slackbuilds.org>2010-05-12 17:44:17 +0200
commit10b0129f4ecd8457c9f6e62f0a3bf7b8aaf5c6cf (patch)
tree0b303d547f329f050cf77d6470730fb79213e564 /network/tor/rc.tor
parent482ff139b82148e05d07ede113748fdad0ff5af3 (diff)
downloadslackbuilds-10b0129f4ecd8457c9f6e62f0a3bf7b8aaf5c6cf.tar.gz
slackbuilds-10b0129f4ecd8457c9f6e62f0a3bf7b8aaf5c6cf.tar.xz
network/tor: Updated for version 0.2.0.35
Diffstat (limited to 'network/tor/rc.tor')
-rw-r--r--network/tor/rc.tor75
1 files changed, 37 insertions, 38 deletions
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