Record onion service domains

This commit is contained in:
Bob Mottram 2016-10-01 15:07:02 +01:00
parent 27368c9424
commit 88f0c36f44
1 changed files with 11 additions and 1 deletions

View File

@ -103,7 +103,17 @@ function add_onion_service {
echo $"${onion_service_name} onion site hostname not found" echo $"${onion_service_name} onion site hostname not found"
exit 76362 exit 76362
fi fi
echo $(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname)
onion_address=$(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname)
# Record the domain in the completion file
if ! grep "${onion_service_name} onion domain" $COMPLETION_FILE; then
echo "${onion_service_name} onion domain:${onion_address}" >> $COMPLETION_FILE
else
sed -i "s|${onion_service_name} onion domain.*|${onion_service_name} onion domain:${onion_address}|g" $COMPLETION_FILE
fi
echo $onion_address
} }
function set_default_onion_domains { function set_default_onion_domains {