From: Boucman Date: Sun, 15 Oct 2017 10:22:47 +0000 (+0200) Subject: Display the systemctl status in green if state is "running" (#7094) X-Git-Tag: v236~323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92f34a9c4774b7bf2d9359821167716ce1974509;p=thirdparty%2Fsystemd.git Display the systemctl status in green if state is "running" (#7094) --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 265983536d0..e4d9ddf4b6a 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);