Files
harbor/status.sh
T
2026-06-27 03:34:50 -07:00

21 lines
610 B
Bash
Executable File

#!/bin/bash
GREEN=$'\033[0;32m'
RED=$'\033[0;31m'
YELLOW=$'\033[0;33m'
RESET=$'\033[0m'
for f in $(find . -name "docker-compose*.yml" | sort); do
[[ -f "$f" ]] || continue
running=$(docker compose -f "$f" ps -q --status running 2>/dev/null | wc -l)
total=$(docker compose -f "$f" config --services 2>/dev/null | wc -l)
if [[ $running -gt 0 ]]; then
status="${GREEN}RUNNING ($running/$total services)${RESET}"
elif [[ $total -gt 0 ]]; then
status="${RED}STOPPED${RESET}"
else
status="${YELLOW}UNKNOWN${RESET}"
fi
printf "%-45s %b\n" "$f" "$status"
done