Browse Source

Wait for onion service to arrive

Bob Mottram 9 years ago
parent
commit
59b462abf9
1 changed files with 18 additions and 2 deletions
  1. 18
    2
      src/freedombone

+ 18
- 2
src/freedombone View File

@@ -6720,7 +6720,15 @@ quit" > $INSTALL_DIR/batch.sql
6720 6720
     fi
6721 6721
 
6722 6722
     systemctl restart tor
6723
-    sleep 8
6723
+
6724
+    sleep_ctr=0
6725
+    while [ ! -f /var/lib/tor/hidden_service_gogs/hostname ]; do
6726
+        sleep 1
6727
+        sleep_ctr=$((sleep_ctr + 1))
6728
+        if [ $sleep_ctr -gt 10 ]; then
6729
+            break
6730
+        fi
6731
+    done
6724 6732
 
6725 6733
     GIT_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_gogs/hostname)
6726 6734
 
@@ -7126,7 +7134,15 @@ function install_xmpp {
7126 7134
     fi
7127 7135
 
7128 7136
     systemctl restart tor
7129
-    sleep 5
7137
+
7138
+    sleep_ctr=0
7139
+    while [ ! -f /var/lib/tor/hidden_service_xmpp/hostname ]; do
7140
+        sleep 1
7141
+        sleep_ctr=$((sleep_ctr + 1))
7142
+        if [ $sleep_ctr -gt 10 ]; then
7143
+            break
7144
+        fi
7145
+    done
7130 7146
 
7131 7147
     if [ ! -f /var/lib/tor/hidden_service_xmpp/hostname ]; then
7132 7148
         echo $'XMPP onion site hostname not found'