#!/bin/sh
#
# identd		This shell script takes care of starting and stopping linux-identd.
#
# chkconfig:	2345 80 30
# description:	identd is a TCP/IP IDENT protocol server 
#		
# processname:	identd
# config:	
# pidfile:

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

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

# Source oident configureation.
if [ -f /etc/sysconfig/identd ] ; then
	. /etc/sysconfig/identd
fi

# Check that networking is up.
if is_no "${NETWORKING}"; then
	msg_Network_Down identd
	exit 1
fi

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	if [ ! -f /var/lock/subsys/identd ]; then
		msg_starting identd
		daemon identd -d
		RETVAL=$?
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/identd
	else
		msg_Already_Running identd
	fi
	;;
  stop)
	# Stop daemons.
	if [ -f /var/lock/subsys/identd ]; then
		msg_stopping identd
		killproc identd
		rm -f /var/lock/subsys/identd >/dev/null 2>&1
	else
		msg_Not_Running identd
		exit 1
	fi	
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status identd
	;;
  *)
	msg_usage "$0 {start|stop|restart|status}"
	exit 1
esac

exit $RETVAL

