Waiting for onions

This commit is contained in:
Bob Mottram 2017-06-11 18:49:54 +01:00
parent 222601c2b6
commit 0e86c3f541
1 changed files with 12 additions and 2 deletions

View File

@ -56,10 +56,20 @@ function wait_for_onion_service_base {
onion_service_name="$1"
sleep_ctr=0
while [ ! -f ${HIDDEN_SERVICE_PATH}${onion_service_name}/hostname ]; do
onion_site_domain=''
while [ ${#onion_site_domain} -lt 2 ]; do
if [ -f ${HIDDEN_SERVICE_PATH}${onion_service_name}/hostname ]; then
onion_site_domain=$(cat ${HIDDEN_SERVICE_PATH}${onion_service_name}/hostname)
fi
if [ ${#onion_site_domain} -gt 1 ]; then
break
fi
sleep 1
sleep_ctr=$((sleep_ctr + 1))
if [ $sleep_ctr -gt 10 ]; then
if [ $sleep_ctr -gt 15 ]; then
break
fi
done