From 8969321f10f506eb3d613d5231ff7fc4deafafac Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 23 Jan 2024 16:58:21 +0100
Subject: [PATCH] do not show containers if total is zero

---
 check_docker_info | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check_docker_info b/check_docker_info
index e558395..06947de 100755
--- a/check_docker_info
+++ b/check_docker_info
@@ -151,7 +151,7 @@ ph.perfadd "images"   "$iImages"
 ph.status "Docker $sVersion ($sLicense) .. containers: $iCTotal running: $iCRunning paused: $iCPaused stopped: $iCStopped .. images: $iImages"
 echo "$out"
 
-if [ $bOptContainers -eq 1 ]; then
+if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then
     echo
     echo "Containers:"
     containers=$( sudo -n --preserve-env docker ps --all --format "{{ json . }}" --all 2>/dev/null )
-- 
GitLab