Use reload rather than restart to avoid ssh disconnections

This commit is contained in:
Bob Mottram 2016-10-11 16:01:06 +01:00
parent 21ef7525d4
commit 44a4957af8
1 changed files with 5 additions and 5 deletions

View File

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