Created
January 25, 2016 19:07
-
-
Save eddywashere/a4ac881a5d0937691a4a to your computer and use it in GitHub Desktop.
conditional docker-machine eval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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