#!/bin/sh
#
# medusa	This shell script takes care of starting and stopping
#               medusa daemons
#
# chkconfig: 345 99 00
# description: Medusa is software that allows you to quickly search your system for particular types of files, using an index. 
#
# Source function library.
. /etc/rc.d/init.d/functions


start() {
    gprintf "Starting webcam server daemon: "
    daemon /usr/bin/webcam_server -s
    echo
}

stop() {
    PID=`pidofproc webcam_server`
    if [ -n "$PID" ]; then
      gprintf "Shutting down webcam server daemon: "
      killproc webcam_server
      echo
    fi
}

case "$1" in
    start)
	start
	;;
 
    stop)
	stop
	;;
 
    restart | reload)
	stop
	start
	;;

    status)
        status webcam_server
	;;

    *)
	echo "Usage: $0 {start|stop|restart|status}" >&2
	exit 1
	;;
esac
