#!/bin/bash # dbanner-title-uk: Контейнери Docker # dbanner-title-en: Docker containers # dbanner-mode: live # Running and stopped containers; nothing when Docker is not there or not reachable. . "${0%/*}/lib.sh" command -v docker >/dev/null || exit 0 mapfile -t states < <(timeout 1 docker ps -a --format '{{.State}}' 2>/dev/null) || exit 0 ((${#states[@]})) || exit 0 running=0 for s in "${states[@]}"; do [[ $s == running ]] && ((running++)); done stopped=$((${#states[@]} - running)) color=$Green ((stopped)) && color=$Yellow echo "$Bold$(say "Docker:" "Docker:")$Off $color$running$Off $(say "працює" "running"), $stopped $(say "зупинено" "stopped")"