Better handling if private key has not yet been generated

This commit is contained in:
Bob Mottram 2018-02-12 10:57:53 +00:00
parent 580f229333
commit 72f753b491
1 changed files with 5 additions and 2 deletions

View File

@ -251,6 +251,9 @@ function install_bdsmail {
echo '#!/bin/bash' > /usr/bin/bdsmail_domain
echo 'cd /etc/bdsmail' >> /usr/bin/bdsmail_domain
echo 'if [ ! -f bdsmail-privkey.dat ]; then' >> /usr/bin/bdsmail_domain
echo ' exit 1' >> /usr/bin/bdsmail_domain
echo 'fi' >> /usr/bin/bdsmail_domain
echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain
chmod +x /usr/bin/bdsmail_domain
@ -259,12 +262,12 @@ function install_bdsmail {
bds_domain=
sleep_ctr=0
while [ ! $bds_domain ]; do
echo $"Waiting for i2p domain to be generated ${sleep_ctr}/30"
echo $"Waiting for i2p domain to be generated ${sleep_ctr}/50"
systemctl restart bdsmail
sleep 10
bds_domain=$(bdsmail_domain)
sleep_ctr=$((sleep_ctr + 1))
if [ $sleep_ctr -gt 30 ]; then
if [ $sleep_ctr -gt 50 ]; then
break
fi
done