#!/bin/sh
#
# sella_nms          Start/Stop the sella_nms daemon.
#
# chkconfig: 2345 98 2
# description: sella_nms is a network management system.
# processname: sella_nms
# config: @resolved_sysconfdir@/sella_nms.conf
# pidfile: @resolved_localstatedir@/sella_nms.pid
#
# $Id: sella_nms.init.d.in,v 1.2 2005/08/14 05:49:25 sella Exp $

# To install script.
# chkconfig --add sella_nms

# To remove...
# chkconfig --del sella_nms

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

PATH="${PATH}:@resolved_sbindir@"

RETVAL=0

case "$1" in
	start)
		echo -n "Starting sella_nms daemon: "
		daemon sella_nms
		RETVAL=$?
		echo
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sella_nms
		;;
	stop)
		echo -n "Stopping sella_nms daemon: "
		killproc sella_nms
		RETVAL=$?
		echo
		[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sella_nms
		;;
	status)
		status sella_nms
		RETVAL=$?
		;;
	restart)
		$0 stop
		$0 start
		RETVAL=$?
		;;
	reload)
		killall -HUP sella_nms
		RETVAL=$?
		;;
	*)
		echo "Usage: sella_nms {start|stop|status|restart|reload}"
		exit 1
esac

exit $RETVAL
