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

Re: boot order



hi.

EMAIL="root"
RESTARTSUBJECT="["`hostname`" "`date`"] – System Startup"
SHUTDOWNSUBJECT="["`hostname`" "`date`"] – System Shutdown"
RESTARTBODY="This is an automated message to notify you that "`hostname`" started successfully. Start up Date and Time: "`date` SHUTDOWNBODY="This is an automated message to notify you that "`hostname`" is shutting down. Shutdown Date and Time: "`date`
LOCKFILE=/var/lock/SystemEmail
RETVAL=0
# Source function library.
. /lib/lsb/init-functions
stop()
 {
 echo -n "Sending Shutdown Email: "
 echo "${SHUTDOWNBODY}" | mail -s "${SHUTDOWNSUBJECT}" ${EMAIL}
 sleep 4
 RETVAL=$?
 sleep 4

i can't comment on the rest of the script, but you probably want
RETVAL to be the exit status of the pipeline that sends the mail.
making RETVAL the exit status of 'sleep 4' looks wrong to me.

maybe the author was trying to tell themself to get more sleep?

 if [ ${RETVAL} -eq 0 ]; then
   rm -f ${LOCKFILE}
   sleep 4
   log_success_msg
 else
   log_failure_msg
 fi
[--more--]

-wes

Reply to: