tor: Only start tor when it has been enabled.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Aug 2013 11:23:51 +0000 (13:23 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Aug 2013 15:22:54 +0000 (17:22 +0200)
src/initscripts/init.d/tor

index e27241f5617e93b53d68ce760df57ccf0d9ea034..4fef577ac7fb2aee0118f0dad1b4643898c65061 100644 (file)
@@ -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