1 |
fauli 09/06/03 13:02:24 |
2 |
|
3 |
Added: tor.initd-r6 |
4 |
Removed: tor.initd-r5 |
5 |
Log: |
6 |
revision bump to make it compatible with Baselayout 1, as reported by Stanislav Cymbalov <DummyUnit AT gmail.com> in bug 272404 |
7 |
(Portage version: 2.1.6.11/cvs/Linux i686, RepoMan options: --force) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-misc/tor/files/tor.initd-r6 |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/tor.initd-r6?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/tor/files/tor.initd-r6?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: tor.initd-r6 |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2005 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License v2 |
20 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/tor.initd-r6,v 1.1 2009/06/03 13:02:24 fauli Exp $ |
21 |
|
22 |
opts="${opts} checkconfig reload" |
23 |
PIDFILE=/var/run/tor/tor.pid |
24 |
CONFFILE=/etc/tor/torrc |
25 |
|
26 |
depend() { |
27 |
need net |
28 |
} |
29 |
|
30 |
checkconfig() { |
31 |
# first check that it exists |
32 |
if [ ! -f ${CONFFILE} ] ; then |
33 |
eerror "You need to setup ${CONFFILE} first" |
34 |
eerror "Example is in ${CONFFILE}.sample" |
35 |
return 1 |
36 |
fi |
37 |
|
38 |
# now verify whether the configuration is valid |
39 |
/usr/bin/tor --verify-config --User tor -f ${CONFFILE} > /dev/null 2>&1 |
40 |
if [ $? -eq 0 ] ; then |
41 |
einfo "Tor configuration (${CONFFILE}) is valid." |
42 |
return 0 |
43 |
else |
44 |
eerror "Tor configuration (${CONFFILE}) not valid." |
45 |
/usr/bin/tor --verify-config --User tor -f ${CONFFILE} |
46 |
return 1 |
47 |
fi |
48 |
} |
49 |
|
50 |
start() { |
51 |
checkconfig || return 1 |
52 |
ebegin "Starting Tor" |
53 |
HOME=/var/lib/tor |
54 |
start-stop-daemon --start --user tor --pidfile "${PIDFILE}" --quiet --exec /usr/bin/tor -- --runasdaemon 1 --PidFile "${PIDFILE}" > /dev/null 2>&1 |
55 |
eend $? |
56 |
} |
57 |
|
58 |
stop() { |
59 |
ebegin "Stopping Tor" |
60 |
start-stop-daemon --stop --user tor --pidfile "${PIDFILE}" --exec /usr/bin/tor -- --PidFile "${PIDFILE}" |
61 |
eend $? |
62 |
} |
63 |
|
64 |
reload() { |
65 |
if [ ! -f ${PIDFILE} ]; then |
66 |
eerror "${SVCNAME} isn't running" |
67 |
return 1 |
68 |
fi |
69 |
checkconfig || return 1 |
70 |
ebegin "Reloading Tor configuration" |
71 |
start-stop-daemon --stop --oknodo --signal HUP --pidfile ${PIDFILE} |
72 |
eend $? |
73 |
} |