소스 검색

Wait for bdsmail initialisation

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

+ 10
- 1
src/freedombone-app-bdsmail 파일 보기

252
     echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain
252
     echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain
253
     chmod +x /usr/bin/bdsmail_domain
253
     chmod +x /usr/bin/bdsmail_domain
254
 
254
 
255
+    # wait for domain to be generated by the daemon
256
+    sleep 10
257
+
258
+    bds_domain=$(bdsmail_domain)
259
+    if [ ! $bds_domain ]; then
260
+        echo $'Failed to get the bdsmail domain'
261
+        exit 8934638
262
+    fi
263
+
255
     # Create mutt configuration
264
     # Create mutt configuration
256
     mkdir /etc/skel/.mutt
265
     mkdir /etc/skel/.mutt
257
     echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail
266
     echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail
258
     echo 'set smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail
267
     echo 'set smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail
259
     echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail
268
     echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail
260
-    echo "set from=username@$(bdsmail_domain)" >> /etc/skel/.mutt/bdsmail
269
+    echo "set from=username@${bds_domain}" >> /etc/skel/.mutt/bdsmail
261
     echo 'set spoolfile=/etc/bdsmail/mail/username' >> /etc/skel/.mutt/bdsmail
270
     echo 'set spoolfile=/etc/bdsmail/mail/username' >> /etc/skel/.mutt/bdsmail
262
 
271
 
263
     # mutt configuration for the admin user
272
     # mutt configuration for the admin user