diff --git a/common.sh b/common.sh index afc24d4..07283fc 100644 --- a/common.sh +++ b/common.sh @@ -129,11 +129,14 @@ stop_containers() { "docker inspect -f '{{.State.Running}}' $c 2>/dev/null" || echo "false") if [[ "$STATUS" == "true" ]]; then - warn "Stopping $c" - RUNNING_CONTAINERS+=("$c") - ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" "docker stop $c" >/dev/null - else - log "$c already stopped" + warn "Stopping $c" + RUNNING_CONTAINERS+=("$c") + + if ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" "docker stop $c" >/dev/null; then + success "$c stopped" + else + error "Failed to stop $c" + fi fi done }