From 58207c3fdef10a59bcfc1a6db2d1f214648f69b4 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 31 Oct 2022 22:43:08 +0000 Subject: [PATCH] Update dotfiles/.local/motd.sh --- dotfiles/.local/motd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/.local/motd.sh b/dotfiles/.local/motd.sh index 0b4a44e0..3c697b43 100644 --- a/dotfiles/.local/motd.sh +++ b/dotfiles/.local/motd.sh @@ -571,17 +571,17 @@ print_updates() { printf " \\033[%sm%s\\033[0m %s\\n" "$updates_color" "$updates_icon" "$updates_message" fi if command -v systemctl > /dev/null; then - running_services_count="$(systemctl --type=service | grep '.service' | wc -l)" + running_services_count="$(systemctl --type=service | grep 'active running' | wc -l)" failed_services_count="$(systemctl --type=service | grep 'failed' | wc -l)" if [ "$failed_services_count" -eq 0 ]; then printf " \\033[%sm%s\\033[0m All enabled services are running!\\n" "32" "" elif [ "$failed_services_count" -eq 1 ]; then - printf " \\033[%sm%s\\033[0m%-3s %s services are are currently running\\n" "32" "" "" "$running_services_count" + printf " \\033[%sm%s\\033[0m %s services are are currently running\\n" "32" "" "" "$running_services_count" printf " \\033[%sm%s\\033[0m 1 service failed to start (%s)\\n" "31" "" "$(systemctl --type=service | grep 'failed' | sed 's/..\([^ ]*\).service.*/\1/')" elif [ "$failed_services_count" -gt 1 ]; then - printf " \\033[%sm%s\\033[0m%-3s %s services are are currently running\\n" "32" "" "" "$running_services_count" - printf " \\033[%sm%s\\033[0m%-3s %s services failed to start (see `systemctl --type=service`)\\n" "31" "" "" "$failed_services_count" + printf " \\033[%sm%s\\033[0m %s services are are currently running\\n" "32" "" "" "$running_services_count" + printf " \\033[%sm%s\\033[0m %s services failed to start (see `systemctl --type=service`)\\n" "31" "" "" "$failed_services_count" fi fi }