Last active
July 10, 2020 06:38
-
-
Save andgineer/fcdb877eb0033234e98b3619d2267b4e to your computer and use it in GitHub Desktop.
Check if a docker-compose service is running
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
| #! /usr/bin/env bash | |
| # | |
| # Check if the $1 docker-compose service is running | |
| # | |
| # Usage: | |
| # is_container_running <service name> | |
| # | |
| function container_is_not_running { | |
| if [[ -z `docker ps -q --no-trunc | grep $(docker-compose ps -q $1)` ]]; then | |
| echo "$1 service is not running." | |
| return 0 # success EXIT code | |
| else | |
| return 1 | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.