Skip to content

Commit

Permalink
fix: correct check to see if service is running
Browse files Browse the repository at this point in the history
This sometimes bizarrely returned a value of 'true' when it wasn't....
  • Loading branch information
josegonzalez committed Mar 9, 2019
1 parent 0f9e567 commit 52f9559
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common-functions
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ service_container_rm() {
local SERVICE_NAME="$(get_service_name "$SERVICE")"

service_stop "$SERVICE"
local ID=$(docker inspect "$SERVICE_NAME" -f '{{ .ID }}' 2> /dev/null || true)
[[ -z "$ID" ]] && return 0
if ! docker inspect "$SERVICE_NAME" -f '{{ .ID }}' > /dev/null 2>&1; then
return 0
fi

dokku_log_verbose_quiet "Removing container"
docker update --restart=no "$SERVICE_NAME" > /dev/null 2>&1
Expand Down

0 comments on commit 52f9559

Please sign in to comment.