[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: color boot text



This would actually be very simple.  Just create an included script with two functions -- init_fail() and init_ok().  These functions simple print "failed" or "ok" in color. Next, just include this script (. /etc/init.d/color_funcs.sh) in every init.d script.  Finally, change "done" to init_ok(), etc..  The only problem is determining when a failure occurs, which is per-package.  It's almost like the beginning of i18n with startup scripts!

try something like (you'll need to know the ascii color codes)
function init_fail() {
	echo -e "\033[31:1mFAILED!\033[0m"
}
function init_ok() {
	echo -e "\033[33:1mOk!\033[0m"
}

Debian could standardize this, but why?  How often to you really watch your system reboot?  I do agree that it would be nice to see a red failed if something failed, but is it worth the effort?

-Paul

On Sun, 2 Jun 2002 03:44:12 +0100 (BST)
"Tom Barnes-Lawrence" <tomble@usermail.com> wrote:

> Hi,
> you wrote:
> > > If I remember correctly, a friend running red hat had color text
> > > while his machine was booting. Is there a howto on how to set this
> > > up?
> > 
> > ...Red Hat's init scripts do some really bizarre things, but one of
> > the consequences of this is that they print output in a ~standard
> > format with a green "OK" or a red "failed".  Debian doesn't have the
> > seventeen-levels-deep-of-included-sh-script thing going, but this
> > means that there's also no obvious/standard way for packages' init
> > scripts to do the "pretty" output.  There's not an easy way to set
> > this up for every package, though it is possible in principle to
> > modify everything in /etc/init.d to do what you want.
>  Could it be possible to create a program, lets call it "colourify"
>  for example (I don't know of one), such that when the init scripts
>  run a program, they direct the program's standard error (or standard
>  output if appropriate) stream into "colourify", and colourify then
>  uses the exit status of the program to determine whether it succeeded
>  or failed. Having determined that, colourify then dumps the text that
>  was fed to it in the appropriate colour- IIRC, the Linux console
>  type uses the same escape codes as xterms and other things, which
>  are in the Xterm postscript documentation.
>  OK, I'm not sure that you could have a program receive another
>  processes output *and* detect its exit status in one go, but y'know...
>  I'm sure something like this is possible without too much effort
>  (though you'd prolly not want to for fsck's progress bar things).
> 
>  Tomble
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: