diff --git a/setup/management.sh b/setup/management.sh index fe71385f..62034f4a 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -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 diff --git a/setup/start.sh b/setup/start.sh index fc0855b3..10c9afa2 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -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