#! /bin/sh
# innd.restart -- start innd 
# Author: tale@isc.org (David Lawrence)

# Based on inn's /etc/rc.news.  It is a separate program because rc.news
# does some things that should _only_ be done at boot time.
# Unlike some "restart" scripts, this one does not actually kill a running
# innd, just tries to start a new one.

##  =()<. @<_PATH_SHELLVARS>@>()=
. /var/news/innshellvars

#  Pick ${INND} or ${INNDSTART}.  Normally ${INNDSTART}.
WHAT=${INNDSTART}

# RFLAG is set below; set FLAGS as appropriate.  This used the
# separate innd.flags file suggested in the book.
RFLAG=""
FLAGS="`cat ${NEWSLIB}/innd.flags`"

# Check for clean shutdown?  If it wasn't clean, -r flag is passed
# to renumber active file at innd's startup.
if [ -f ${SERVERPID} ] ; then
    echo 'INND:  PID file exists -- unclean termination or already running!'
    echo 'INND:  will renumber active file during startup'
    RFLAG="-r"
fi

##  Start the show.
eval ${WHAT} ${RFLAG} ${FLAGS}
