motd.sh: Make docker optional

This commit is contained in:
Alice Gaudon 2023-08-19 19:43:01 +02:00
parent c6192fc397
commit cb8e2fc73f

View File

@ -57,6 +57,7 @@ done
### Docker ###
if command -v docker &> /dev/null; then
out+="${bold}[DOCKER]${undim}\n"
containers=($(docker ps --format "{{.Image}}/{{.Names}}"))
container_statuses=($(docker ps --format "{{.State}}"))
@ -95,6 +96,7 @@ for user in ${rootless_users[@]}; do
done
done
out+=$docker_out
fi
printf "$out" | column -ts $',' -o " "
echo -e