Skip to content
Snippets Groups Projects
Commit 5b782e51 authored by Bob Mottram's avatar Bob Mottram
Browse files

Ensure that v2 onion address flag gets cleared on each call

parent 3e03e30f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment