]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/tor
tor: Only start tor when it has been enabled.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / tor
index d3761782410c9aed93cb8d3c0b910723553503cf..4fef577ac7fb2aee0118f0dad1b4643898c65061 100644 (file)
@@ -9,8 +9,12 @@
 . /etc/sysconfig/rc
 . ${rc_functions}
 
+function tor_is_enabled() {
+       [ "${TOR_ENABLED}" = "on" ] || [ "${TOR_RELAY_ENABLED}" = "on" ]
+}
+
 function setup_firewall() {
-       eval $(readhash /var/ipfire/tor/settings)
+       eval $(/usr/local/bin/readhash /var/ipfire/tor/settings)
 
        # Flush all rules.
        flush_firewall
@@ -27,6 +31,8 @@ function flush_firewall() {
 
 case "${1}" in
        start)
+               tor_is_enabled || exit 0
+
                # Setup firewall.
                setup_firewall