summaryrefslogtreecommitdiff
blob: b714ee56fde8b89764d5e05762a300fb65c4b961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/tor.initd,v 1.1 2005/02/10 21:12:02 humpback Exp $

depend() {
        need net
}

checkconfig() {
        # first check that it exists
        if [ ! -f /etc/tor/torrc ] ; then
                eerror "You need to setup /etc/tor/torrc first"
                eerror "Example is in /etc/tor"
                eerror "for info: info sockd.conf"
                return 1
        fi
}



start() {
	checkconfig || return 1
        ebegin "Starting Tor"
        HOME=/var/lib/tor
        start-stop-daemon --start --quiet --chuid tor --exec /usr/bin/tor -- --runasdaemon 1
        eend $?
}

stop() {
        ebegin "Stopping Tor"
        start-stop-daemon --stop --quiet --chuid tor --exec /usr/bin/tor
        eend $?
}