From 59b462abf98e97dd4aa6141487ef6cc0454eb179 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 Jan 2016 19:54:21 +0000 Subject: [PATCH] Wait for onion service to arrive --- src/freedombone | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/freedombone b/src/freedombone index 1d0bd2db..a2c6cb77 100755 --- a/src/freedombone +++ b/src/freedombone @@ -6720,7 +6720,15 @@ quit" > $INSTALL_DIR/batch.sql fi systemctl restart tor - sleep 8 + + sleep_ctr=0 + while [ ! -f /var/lib/tor/hidden_service_gogs/hostname ]; do + sleep 1 + sleep_ctr=$((sleep_ctr + 1)) + if [ $sleep_ctr -gt 10 ]; then + break + fi + done GIT_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_gogs/hostname) @@ -7126,7 +7134,15 @@ function install_xmpp { fi systemctl restart tor - sleep 5 + + sleep_ctr=0 + while [ ! -f /var/lib/tor/hidden_service_xmpp/hostname ]; do + sleep 1 + sleep_ctr=$((sleep_ctr + 1)) + if [ $sleep_ctr -gt 10 ]; then + break + fi + done if [ ! -f /var/lib/tor/hidden_service_xmpp/hostname ]; then echo $'XMPP onion site hostname not found'