#!/bin/sh
#
#  Created 2000-01-03 by jaclu@grm.se
#
# nrpe          This shell script takes care of starting and stopping
#               nrpe.
#
# chkconfig: 2345 80 30
# description: nrpe is a daemon for a remote netsaint server, \
#              running netsaint plugins on this host.
# processname: nrpe
# config: /usr/local/netsaint/etc/nrpe.cfg

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting nrpe: "
	daemon /usr/local/netsaint/bin/nrpe /usr/local/netsaint/etc/nrpe.cfg
	echo
	touch /var/lock/subsys/nrpe
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down nrpe: "
	killproc nrpe
	echo
	rm -f /var/lock/subsys/nrpe
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status nrpe
	;;
  *)
	echo "Usage: nrpe {start|stop|restart|status}"
	exit 1
esac

exit 0
