Browse Source

Ensure that the tor config files remain active even if the original torrc was overwritten

Bob Mottram 6 years ago
parent
commit
5b5050a708
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/freedombone-utils-onion

+ 4
- 0
src/freedombone-utils-onion View File

@@ -35,6 +35,10 @@ ONION_SERVICES_FILE=/etc/torrc.d/${PROJECT_NAME}
35 35
 
36 36
 function torrc_migrate {
37 37
     if [ -f $ONION_SERVICES_FILE ]; then
38
+        if grep -q "#%include /etc/torrc.d" /etc/tor/torrc; then
39
+            sed -i 's|#%include /etc/torrc.d|%include /etc/torrc.d|g' /etc/tor/torrc
40
+            systemctl restart tor
41
+        fi
38 42
         return
39 43
     fi
40 44
     systemctl stop tor