motd.sh: fix docker display
This commit is contained in:
parent
d6a1b3ef6a
commit
e7769419b1
6
motd.sh
6
motd.sh
@ -36,7 +36,7 @@ for service in "${services[@]}"; do
|
||||
done
|
||||
|
||||
out=""
|
||||
for i in ${!services[@]}; do
|
||||
for i in "${!services[@]}"; do
|
||||
# color green if service is active, else red
|
||||
if [[ "${service_status[$i]}" == "active" ]]; then
|
||||
out+="${services[$i]}:,${green}${service_status[$i]}${undim},"
|
||||
@ -55,8 +55,8 @@ printf "$out" | column -ts $',' | sed -e 's/^/ /'
|
||||
|
||||
|
||||
### Docker ###
|
||||
containers=($(docker ps -a --format "{{.Image}} / {{.Names}}"))
|
||||
container_statuses=($(docker ps -a --format "{{.State}}"))
|
||||
containers=($(docker ps --format "{{.Image}}/{{.Names}}"))
|
||||
container_statuses=($(docker ps --format "{{.State}}"))
|
||||
out=""
|
||||
for i in ${!containers[@]}; do
|
||||
if [[ "${container_statuses[$i]}" == "running" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user