#! /bin/sh
#
# slpd    Start/Stop the OpenSLP SA daemon (slpd).
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#         Modified for RHS Linux by Damien Neil
#	  Modified for COL by Raymund Will, <ray@lst.de>
# 	  Modified for OpenSLP by Matt Peterson <mpeterson@calderasystems.com>
#
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Default-Start: <run level 3> <run level 4> <run level 5>
# Default-Stop: <run level 0> <run level 1> <run level 2> <run level 6>
# Description: gpm - General Purpose Mouse
### END INIT INFO 

NAME=slpd
DAEMON=/usr/sbin/$NAME

# Source function library.
. /etc/rc.d/init.d/functions

# Change to root
cd /

# See how we were called.
case "$1" in
 start)
  [ -e $SVIlock ] && exit 1
  [ -x $DAEMON ] || exit 0

  echo -n "Starting slpd daemon:"
  ssd -S -n $NAME -x $DAEMON -- $OPTIONS
	
  echo "."
  touch $SVIlock
  ;;

 stop)
  [ -e $SVIlock ] || exit 0

  echo -n "Stopping slpd daemon: "
  ssd -K -p /var/run/$NAME.pid -n $NAME
  rm /var/run/$NAME.pid
  echo "."
  rm -f $SVIlock
  ;;

 *)
  echo "Usage: $SVIscript {start|stop}"
  exit 1
esac

exit 0
