From d319ecf1457ea987f39c1b3c4feb3c4a9e63a715 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 9 Mar 2019 15:09:14 -0500 Subject: [PATCH] fix: correct check to see if service is running This sometimes bizarrely returned a value of 'true' when it wasn't.... --- common-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common-functions b/common-functions index d126f3d..a2c0827 100755 --- a/common-functions +++ b/common-functions @@ -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