1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-22 02:17:26 +00:00

docker: if container was launched with a tty start bash otherwise loop forever to keep the container going

This commit is contained in:
Joshua Tauberer 2014-05-01 22:16:14 -04:00
parent 7999eae857
commit 16c0a9d342

View File

@ -8,5 +8,22 @@ service opendkim start
service nginx start service nginx start
service php-fastcgi start service php-fastcgi start
echo "Your Mail-in-a-Box is running." if [ -t 0 ]
then
# This is an interactive shell. You get a command prompt within
# the container.
#
# You get here by running 'docker run -i -t'.
echo "Welcome to your Mail-in-a-Box."
bash bash
else
# This is a non-interactive shell. It loops forever to prevent
# the docker container from stopping.
#
# You get here by omitting '-t' from the docker run arguments.
echo "Your Mail-in-a-Box is running..."
while true; do sleep 10; done
fi