From d1be62d225fb3df1c5064619213aa65d2e5527fd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 1 Jun 2017 15:15:05 +0100 Subject: [PATCH] Tor things --- src/freedombone-base-email | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/freedombone-base-email b/src/freedombone-base-email index fc248bfc..84ba3a8a 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -157,10 +157,12 @@ function configure_email_onion { return fi - echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/' >> /etc/tor/torrc - echo 'HiddenServicePort 25 127.0.0.1:25' >> /etc/tor/torrc - echo 'HiddenServicePort 587 127.0.0.1:587' >> /etc/tor/torrc - echo 'HiddenServicePort 465 127.0.0.1:465' >> /etc/tor/torrc + if ! grep -q "hidden_service_email" /etc/tor/torrc; then + echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/' >> /etc/tor/torrc + echo 'HiddenServicePort 25 127.0.0.1:25' >> /etc/tor/torrc + echo 'HiddenServicePort 587 127.0.0.1:587' >> /etc/tor/torrc + echo 'HiddenServicePort 465 127.0.0.1:465' >> /etc/tor/torrc + fi function_check onion_update onion_update @@ -170,6 +172,7 @@ function configure_email_onion { if [[ $(onion_service_exists email) == "0" ]]; then echo $"email onion site hostname not found" + systemctl restart tor exit 782352 fi