sleep for a while to wait for tox keys to be generated

This commit is contained in:
Bob Mottram 2016-05-30 18:30:00 +01:00
parent a82f68abe4
commit c202ad4e6e
1 changed files with 4 additions and 0 deletions

View File

@ -463,12 +463,16 @@ function configure_toxcore {
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
echo $'Enabling toxcore daemon' >> $INSTALL_LOG
systemctl enable tox-bootstrapd.service
echo $'Regenerating Tox bootstrap node keys' >> $INSTALL_LOG
systemctl stop tox-bootstrapd.service
if [ -f /var/lib/tox-bootstrapd/keys ]; then
rm /var/lib/tox-bootstrapd/keys
fi
systemctl start tox-bootstrapd.service
# sleep for a while so that the tox keys can be generated
sleep 30
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then