Don't restart tor if not needed

This commit is contained in:
Bob Mottram 2016-01-09 18:56:12 +00:00
parent ba8f72ad91
commit 698cba0449
1 changed files with 6 additions and 0 deletions

View File

@ -1294,6 +1294,12 @@ function add_onion_service {
onion_service_name="$1"
onion_service_port_from=$2
onion_service_port_to=$3
if [ -f /var/lib/tor/hidden_service_${onion_service_name}/hostname ]; then
echo $(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname)
return
fi
if [ ! -d /var/lib/tor ]; then
echo $"No Tor installation found. ${onion_service_name} onion site cannot be configured."
exit 877367