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

Use reload rather than restart to avoid ssh disconnections

parent 21ef7525
No related branches found
No related tags found
No related merge requests found
......@@ -41,8 +41,8 @@ function wait_for_onion_service {
done
if [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; then
# restart and try a second time
systemctl restart tor
# reload and try a second time
systemctl reload tor
sleep_ctr=0
while [ ! -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; do
sleep 1
......@@ -72,7 +72,7 @@ function remove_onion_service {
shred -zu /var/lib/tor/hidden_service_${onion_service_name}/*
rm -rf /var/lib/tor/hidden_service_${onion_service_name}
fi
systemctl restart tor
systemctl reload tor
}
function add_onion_service {
......@@ -94,7 +94,7 @@ function add_onion_service {
echo "HiddenServicePort ${onion_service_port_from} 127.0.0.1:${onion_service_port_to}" >> /etc/tor/torrc
fi
systemctl restart tor
systemctl reload tor
function_check wait_for_onion_service
wait_for_onion_service ${onion_service_name}
......@@ -253,7 +253,7 @@ function resolve_dns_via_tor {
echo 'DNSPort 53' >> /etc/tor/torrc
echo 'AutomapHostsOnResolve 1' >> /etc/tor/torrc
echo 'AutomapHostsSuffixes .exit,.onion' >> /etc/tor/torrc
systemctl restart tor
systemctl reload tor
fi
# don't change resolv.conf
......
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