From 025f53864b557c5a1464458b556c31bfe397be41 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 20 Aug 2023 13:44:00 +0200 Subject: [PATCH] motd.sh: inactive and disabled services are not a failure --- motd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/motd.sh b/motd.sh index 732d1e0..4463238 100755 --- a/motd.sh +++ b/motd.sh @@ -50,8 +50,10 @@ 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}\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" + else + out+=" - ${services[$i]},${dim}${service_status[$i]} (disabled)${undim}\n" fi done