Skip to content

Instantly share code, notes, and snippets.

@zaltoprofen
Created September 15, 2016 07:55
Show Gist options
  • Save zaltoprofen/82110363583858db143f6b46979467ab to your computer and use it in GitHub Desktop.
Save zaltoprofen/82110363583858db143f6b46979467ab to your computer and use it in GitHub Desktop.
AUTO_LOAD_DOCKER_MACHINE=dev
MAYBE_LOAD=$(docker-machine ls --filter STATE=running --filter "NAME=$AUTO_LOAD_DOCKER_MACHINE" -f "{{.Name}}")
if [ "$MAYBE_LOAD" = "$AUTO_LOAD_DOCKER_MACHINE" ]; then
eval $(docker-machine env "$MAYBE_LOAD")
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment