added nice status script

This commit is contained in:
2026-06-26 18:57:13 -07:00
parent 60b96ddfa0
commit 7199fbe500
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
GREEN=$'\033[0;32m'
RED=$'\033[0;31m'
YELLOW=$'\033[0;33m'
RESET=$'\033[0m'
for f in docker-compose*.yml; 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