#!/bin/bash

. /etc/init.d/functions

PROG="${0##*/}"
PROG="${PROG#[SK]*:}"
PROG="${PROG%.sh}"

PIDFILE=
LOCKFILE=/var/lock/subsys/$PROG
RETVAL=0

start()   { :; }
stop()    { :; }
restart() { stop; start; }
reload()  { restart; }

status()
{
	if [ ! -e "$LOCKFILE" ]; then
		echo "$PROG is stopped"
		RETVAL=3
	else
		echo "$PROG is running"
	fi
	exit $RETVAL
}

switch()
{
	case "$1" in
		start|stop|status|reload|restart) "$1"       ;;
		condstop)    [ ! -e "$LOCKFILE" ] || stop    ;;
		condrestart) [ ! -e "$LOCKFILE" ] || restart ;;
		condreload)  [ ! -e "$LOCKFILE" ] || reload  ;;
		*)
			msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
			RETVAL=1
	esac
	exit $RETVAL
}
