Skip to content

Instantly share code, notes, and snippets.

@eddywashere
Created January 25, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddywashere/a4ac881a5d0937691a4a to your computer and use it in GitHub Desktop.
Save eddywashere/a4ac881a5d0937691a4a to your computer and use it in GitHub Desktop.
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