]> 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 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