motd.sh: Make docker optional
This commit is contained in:
parent
c6192fc397
commit
cb8e2fc73f
2
motd.sh
2
motd.sh
@ -57,6 +57,7 @@ done
|
|||||||
|
|
||||||
|
|
||||||
### Docker ###
|
### Docker ###
|
||||||
|
if command -v docker &> /dev/null; then
|
||||||
out+="${bold}[DOCKER]${undim}\n"
|
out+="${bold}[DOCKER]${undim}\n"
|
||||||
containers=($(docker ps --format "{{.Image}}/{{.Names}}"))
|
containers=($(docker ps --format "{{.Image}}/{{.Names}}"))
|
||||||
container_statuses=($(docker ps --format "{{.State}}"))
|
container_statuses=($(docker ps --format "{{.State}}"))
|
||||||
@ -95,6 +96,7 @@ for user in ${rootless_users[@]}; do
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
out+=$docker_out
|
out+=$docker_out
|
||||||
|
fi
|
||||||
|
|
||||||
printf "$out" | column -ts $',' -o " "
|
printf "$out" | column -ts $',' -o " "
|
||||||
echo -e
|
echo -e
|
||||||
|
Loading…
Reference in New Issue
Block a user