From 5b5050a7080f5dbd43342a43a7337710cc79ec5c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 20 Apr 2018 13:05:00 +0100 Subject: [PATCH] Ensure that the tor config files remain active even if the original torrc was overwritten --- src/freedombone-utils-onion | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index c75851be..6bdb4cff 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -35,6 +35,10 @@ ONION_SERVICES_FILE=/etc/torrc.d/${PROJECT_NAME} function torrc_migrate { if [ -f $ONION_SERVICES_FILE ]; then + if grep -q "#%include /etc/torrc.d" /etc/tor/torrc; then + sed -i 's|#%include /etc/torrc.d|%include /etc/torrc.d|g' /etc/tor/torrc + systemctl restart tor + fi return fi systemctl stop tor