I'm using docker-machine to manage my cloud servers. I'm writing some bash scripts to automate some tasks. The question is: "How to check in bash script if docker machine with the specific name already exists?". I need some expression to return true if it exists and false if it doesn't.
Thanks
Not a scripting guru but I would do a "
docker-machine help", if this command runs and the exit code ($?) is zero, the docker-machine executable is available and functioning. If the return code is 127 (typically this returned by bash for command not found) or anything other than non-zero, you can assume that either docker-machine is not installed or is not running properly.