diff options
author | Roy Marples <roy@marples.name> | 2007-12-06 11:16:27 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-06 11:16:27 +0000 |
commit | 17585a3c044f942e838eb928c24511eaea5c25ba (patch) | |
tree | 81281e7c34fb33991ea1abd341db94d8e35bad01 | |
parent | d3436344eeed79fcb9b0d59d3d9231bad31b310a (diff) |
Don't be spammy or interactive when we don't output
-rw-r--r-- | src/rc.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -495,6 +495,9 @@ static bool want_interactive (void) static bool gotinteractive; static bool interactive; + if (rc_yesno (getenv ("EINFO_QUIET"))) + return (false); + if (PREVLEVEL && strcmp (PREVLEVEL, "N") != 0 && strcmp (PREVLEVEL, "S") != 0 && @@ -958,7 +961,8 @@ int main (int argc, char **argv) signal (SIGUSR1, handle_signal); signal (SIGWINCH, handle_signal); - interactive = exists (INTERACTIVE); + if (! rc_yesno (getenv ("EINFO_QUIET"))) + interactive = exists (INTERACTIVE); rc_plugin_load (); /* Check we're in the runlevel requested, ie from @@ -989,7 +993,8 @@ int main (int argc, char **argv) ecolor (ECOLOR_GOOD), ecolor (ECOLOR_HILITE), ecolor (ECOLOR_NORMAL)); - if (rc_conf_yesno ("rc_interactive")) + if (! rc_yesno (getenv ("EINFO_QUIET")) && + rc_conf_yesno ("rc_interactive")) printf ("Press %sI%s to enter interactive boot mode\n\n", ecolor (ECOLOR_GOOD), ecolor (ECOLOR_NORMAL)); @@ -1233,12 +1238,17 @@ int main (int argc, char **argv) We have different rules dependent on runlevel. */ if (newlevel && strcmp (newlevel, bootlevel) == 0) { if (coldplugged_services) { - einfon ("Device initiated services:"); + bool quiet = rc_yesno (getenv ("EINFO_QUIET")); + + if (! quiet) + einfon ("Device initiated services:"); STRLIST_FOREACH (coldplugged_services, service, i) { - printf (" %s", service); + if (! quiet) + printf (" %s", service); rc_strlist_add (&start_services, service); } - printf ("\n"); + if (! quiet) + printf ("\n"); } tmplist = rc_services_in_runlevel (newlevel ? newlevel : runlevel); rc_strlist_join (&start_services, tmplist); |