Use netcat to check if mailinabox webservice is available

This commit is contained in:
Toilal 2015-04-04 17:44:14 +02:00
parent 5b23a06a74
commit 2b9ce85ba8
2 changed files with 3 additions and 5 deletions

View File

@ -41,8 +41,5 @@ EOF
chmod +x /etc/cron.daily/mailinabox-statuschecks
# Start it. Remove the api key file first so that start.sh
# can wait for it to be created to know that the management
# server is ready.
rm -f /var/lib/mailinabox/api.key
# Start it.
restart_service mailinabox

View File

@ -72,7 +72,8 @@ if [ ! -z "$IS_DOCKER" ]; then
fi
# Ping the management daemon to write the DNS and nginx configuration files.
while [ ! -f /var/lib/mailinabox/api.key ]; do
until nc -z -w 4 localhost 10222
do
echo Waiting for the Mail-in-a-Box management daemon to start...
sleep 2
done