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

This commit is contained in:
Bob Mottram 2018-04-20 13:05:00 +01:00
parent dce5921d5d
commit 5b5050a708
1 changed files with 4 additions and 0 deletions

View File

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