Skip to content
Snippets Groups Projects

do not show containers if total is zero

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -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 )
Loading