Skip to content

Instantly share code, notes, and snippets.

@eddywashere
Created Jan 25, 2016
Embed
What would you like to do?
conditional docker-machine eval
# assumes your docker-machine is called "dev"
docker_running=$(docker-machine ls | grep dev)
if [[ "$docker_running" == *"Stopped"* ]]
then
echo "fyi - docker not running"
elif [[ "$docker_running" == *"Running"* ]]
then
eval "$(docker-machine env dev)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment