#!/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 --user root "/usr/bin/webcam_server &"
    echo
}

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


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

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

