Better handling if private key has not yet been generated
This commit is contained in:
parent
580f229333
commit
72f753b491
|
@ -251,6 +251,9 @@ function install_bdsmail {
|
||||||
|
|
||||||
echo '#!/bin/bash' > /usr/bin/bdsmail_domain
|
echo '#!/bin/bash' > /usr/bin/bdsmail_domain
|
||||||
echo 'cd /etc/bdsmail' >> /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
|
echo 'python2 get_address bdsmail-privkey.dat' >> /usr/bin/bdsmail_domain
|
||||||
chmod +x /usr/bin/bdsmail_domain
|
chmod +x /usr/bin/bdsmail_domain
|
||||||
|
|
||||||
|
@ -259,12 +262,12 @@ function install_bdsmail {
|
||||||
bds_domain=
|
bds_domain=
|
||||||
sleep_ctr=0
|
sleep_ctr=0
|
||||||
while [ ! $bds_domain ]; do
|
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
|
systemctl restart bdsmail
|
||||||
sleep 10
|
sleep 10
|
||||||
bds_domain=$(bdsmail_domain)
|
bds_domain=$(bdsmail_domain)
|
||||||
sleep_ctr=$((sleep_ctr + 1))
|
sleep_ctr=$((sleep_ctr + 1))
|
||||||
if [ $sleep_ctr -gt 30 ]; then
|
if [ $sleep_ctr -gt 50 ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue