[Sunhelp] A scripting question

Adrian Petrescu a_petrescu at hotmail.com
Thu Nov 25 21:49:09 CST 1999


As far as I remember, "$?" is the exit status of the last executed command.

Let's try something like this:
-------------------------------------------------------
#! /bin/ksh
# Checking if the Apache httpd daemon is running
_Var=`ps -ef|grep httpd|grep -v grep`
if [ -z "$_Var" ]
then
  wall -a $HOME/Message
  /etc/rc3.d/S77apachectl start
fi
# End of script

-------------------------------------------------------

You have to create a file  called Message in your home directory with the 
message you want to send to the users.

You must check also if the S77apachectl process is executable by the script.

Hope it helps,
-Adrian-

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com






More information about the SunHELP mailing list