added nice status script
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user