From: Michael Tremer Date: Mon, 19 Aug 2013 11:23:51 +0000 (+0200) Subject: tor: Only start tor when it has been enabled. X-Git-Tag: v2.13-core73~41 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=3765eb6179d721093c834e3483fdef8232b5b486 tor: Only start tor when it has been enabled. --- diff --git a/src/initscripts/init.d/tor b/src/initscripts/init.d/tor index e27241f561..4fef577ac7 100644 --- a/src/initscripts/init.d/tor +++ b/src/initscripts/init.d/tor @@ -9,6 +9,10 @@ . /etc/sysconfig/rc . ${rc_functions} +function tor_is_enabled() { + [ "${TOR_ENABLED}" = "on" ] || [ "${TOR_RELAY_ENABLED}" = "on" ] +} + function setup_firewall() { eval $(/usr/local/bin/readhash /var/ipfire/tor/settings) @@ -27,6 +31,8 @@ function flush_firewall() { case "${1}" in start) + tor_is_enabled || exit 0 + # Setup firewall. setup_firewall