motd.sh: inactive and disabled services are not a failure

This commit is contained in:
Alice Gaudon 2023-08-20 13:44:00 +02:00
parent cb8e2fc73f
commit 025f53864b

View File

@ -50,8 +50,10 @@ for i in "${!services[@]}"; do
# color green if service is active, else red # color green if service is active, else red
if [[ "${service_status[$i]}" == "active" ]]; then if [[ "${service_status[$i]}" == "active" ]]; then
out+=" - ${services[$i]},${green}${service_status[$i]}${undim}\n" out+=" - ${services[$i]},${green}${service_status[$i]}${undim}\n"
else elif [[ "${service_status[$i]}" != "inactive" ]] || [[ "$(systemctl is-enabled ${services[$i]})" == "enabled" ]]; then
out+=" ${redbg}/!\\\\${undim} - ${services[$i]},${red}${service_status[$i]}${undim}\n" out+=" ${redbg}/!\\\\${undim} - ${services[$i]},${red}${service_status[$i]}${undim}\n"
else
out+=" - ${services[$i]},${dim}${service_status[$i]} (disabled)${undim}\n"
fi fi
done done