From 92f34a9c4774b7bf2d9359821167716ce1974509 Mon Sep 17 00:00:00 2001 From: Boucman Date: Sun, 15 Oct 2017 12:22:47 +0200 Subject: [PATCH] Display the systemctl status in green if state is "running" (#7094) --- src/systemctl/systemctl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 2659835..e4d9ddf 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5239,11 +5239,13 @@ static int show_system_status(sd_bus *bus) { if (streq_ptr(mi.state, "degraded")) { on = ansi_highlight_red(); off = ansi_normal(); - } else if (!streq_ptr(mi.state, "running")) { + } else if (streq_ptr(mi.state, "running")) { + on = ansi_highlight_green(); + off = ansi_normal(); + } else { on = ansi_highlight_yellow(); off = ansi_normal(); - } else - on = off = ""; + } printf("%s%s%s %s\n", on, special_glyph(BLACK_CIRCLE), off, arg_host ? arg_host : hn); -- 2.7.4