소스 검색

More retries

Bob Mottram 7 년 전
부모
커밋
580f229333
1개의 변경된 파일17개의 추가작업 그리고 12개의 파일을 삭제
  1. 17
    12
      src/freedombone-app-bdsmail

+ 17
- 12
src/freedombone-app-bdsmail 파일 보기

@@ -255,21 +255,26 @@ function install_bdsmail {
255 255
     chmod +x /usr/bin/bdsmail_domain
256 256
 
257 257
     # wait for domain to be generated by the daemon
258
-    echo $'Waiting for i2p domain to be generated...'
259
-    sleep 15
260
-    bds_domain=$(bdsmail_domain)
261
-    if [ ! $bds_domain ]; then
262
-        echo $'Waiting...'
258
+    # This can take a while, probably because i2p is connecting
259
+    bds_domain=
260
+    sleep_ctr=0
261
+    while [ ! $bds_domain ]; do
262
+        echo $"Waiting for i2p domain to be generated ${sleep_ctr}/30"
263 263
         systemctl restart bdsmail
264
-        sleep 15
264
+        sleep 10
265 265
         bds_domain=$(bdsmail_domain)
266
-        if [ ! $bds_domain ]; then
267
-            #systemctl stop bdsmail
268
-            #systemctl disable bdsmail
269
-            #remove_i2p
270
-            echo $'Failed to get the bdsmail domain'
271
-            exit 8934638
266
+        sleep_ctr=$((sleep_ctr + 1))
267
+        if [ $sleep_ctr -gt 30 ]; then
268
+            break
272 269
         fi
270
+    done
271
+
272
+    if [ ! $bds_domain ]; then
273
+        #systemctl stop bdsmail
274
+        #systemctl disable bdsmail
275
+        #remove_i2p
276
+        echo $'Failed to get the bdsmail domain'
277
+        exit 8934638
273 278
     fi
274 279
 
275 280
     # Create mutt configuration