LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   help with init script output (http://www.linuxquestions.org/questions/linux-general-1/help-with-init-script-output-178989/)

ierickson 05-07-2004 12:05 PM

help with init script output
 
hello!

Anybody, please help:

I'm writing a init script to go on RedHat distros, that upon each boot, monitors the state of a driver and performs a build or corrections as needed.

Anyway... the problem is I don't understand how screen output works in the environment an init script is in.

I mean, I have a init script something like this:

<snip>
prog=nvconfig
RETVAL=0

runlevel=$(set -- $(runlevel); eval "echo \$$#")
current_kernel=$(uname -r)
homedir="/opt/graphics/nvidia"

case "$1" in
start)
echo -n $"Starting $prog: HELLO! "

# Forcing a failure to stderr
# echo " "

# If a nVIDIA card is installed...
if [ $( grep -qi nvidia /proc/pci && echo 1 || echo 0 ) = 1 ]
then
#if driver is not installed...
if [ ! -f /usr/bin/nvidia-installer ]
then
echo "Configuring nVIDIA accelerated driver..."
${homedir}/configure
</snip>

My problem is that I want my 'echo's to show up on the screen during boot, and the crazy thing is that I have two versions of this script, one that works, echos out the "Sarting nvconfig: HELLO!" and "Configuring nVIDIA ..." and one script that doesn't. The CRAZY thing is the only difference between the two, is that the script that doesn't work is missing the two commented out lines: # Forcing ... and # echo " "

Can anyone explain what's going on? How can I make sure my echo's and stderr output goes the screen?

Thanks!


All times are GMT -5. The time now is 03:15 AM.