From 5b782e51fd152be6869d83fe681a1e50ab3a238e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 23 Feb 2018 11:49:00 +0000 Subject: [PATCH] Ensure that v2 onion address flag gets cleared on each call --- src/freedombone-utils-onion | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index bc8081e7..b511f59a 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -116,11 +116,13 @@ function add_onion_service { if [ -f ${HIDDEN_SERVICE_PATH}${onion_service_name}/hostname ]; then echo $(cat ${HIDDEN_SERVICE_PATH}${onion_service_name}/hostname) + USE_V2_ONION_ADDRESS= return fi if [ ! -d /var/lib/tor ]; then echo $"No Tor installation found. ${onion_service_name} onion site cannot be configured." + USE_V2_ONION_ADDRESS= exit 877367 fi if ! grep -q "hidden_service_${onion_service_name}" /etc/tor/torrc; then @@ -129,7 +131,6 @@ function add_onion_service { echo 'HiddenServiceVersion 3' >> /etc/tor/torrc else echo 'HiddenServiceVersion 2' >> /etc/tor/torrc - USE_V2_ONION_ADDRESS= fi echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc if [ ${#onion_stealth_name} -gt 0 ]; then @@ -137,6 +138,8 @@ function add_onion_service { fi fi + USE_V2_ONION_ADDRESS= + onion_update function_check wait_for_onion_service