Echoes True if a docker container is running and False if not
1
container_name="${1:-world}"
2
3
# check if the container exists
4
if docker ps -a | grep -q "$container_name"; then
5
echo "true"
6
else
7
echo "false"
8
fi
9