# --- valiable
if [ ! "$EXEDIR" ] ; then
EXEDIR=/usr/local/sbin
else
if [ ! -d "$EXEDIR" ] ; then
echo "Wrong directory name(EXEDIR='$EXEDIR')."
exit 1
fi
fi
PIDAC=`pidofproc $EXENAME`
case "$1" in
start)
if [ -n "$PIDAC" ] ; then
echo "$SRVNAME already exists (pid=$PIDAC)."
exit 1
fi
echo -n "Starting $SRVNAME: "
daemon $EXEDIR/$EXENAME $EXEOPT
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
touch /var/lock/subsys/$EXENAME
fi
echo ""
;;
stop)
if [ -z "$PIDAC" ] ; then
echo "$SRVNAME not exist."
exit 1
fi
echo -n "Shutting down $SRVNAME: "
killproc $EXENAME
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
rm -f /var/lock/subsys/$EXENAME
fi
echo ""
;;
restart)
$0 stop
$0 start
;;
status)
if [ -z "$PIDAC" ] ; then
echo "$SRVNAME not exist."
exit 0
fi
echo "$SRVNAME exists."
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
exit 1
esac
exit 0
--- [ End of 'dices'] --------------------------------------------------------