fix: correct check to see if service is running

This sometimes bizarrely returned a value of 'true' when it wasn't....
This commit is contained in:
Jose Diaz-Gonzalez
2019-03-09 15:09:14 -05:00
parent 62902e7d9c
commit 42ded61b2b

View File

@@ -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