--- /etc/init.d/tor2 2007-04-25 23:15:56.000000000 +0200 +++ /etc/init.d/tor 2007-04-25 20:19:20.000000000 +0200 @@ -3,30 +3,21 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/tor.initd,v 1.4 2005/09/11 23:14:16 humpback Exp $ -opts="${opts} checkconfig" - 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/torrc.sample" return 1 - else - /usr/bin/tor --verify-config -f /etc/tor/torrc &>/dev/null - if [ $? -eq 0 ] - then - einfo "Tor configuration (/etc/tor/torrc) is valid." - else - eerror "Tor configuration (/etc/tor/torrc) not valid." - /usr/bin/tor --verify-config -f /etc/tor/torrc - return 1 - fi fi } + + start() { checkconfig || return 1 ebegin "Starting Tor"