cvsdist 0bb98ee
#!/bin/bash
cvsdist af3b546
#
cvsdist af3b546
# krb524       Start and stop the krb524 service.
cvsdist af3b546
#
cvsdist af3b546
# chkconfig:   - 35 65
cvsdist af3b546
# description: Kerberos 5 is a trusted third-party authentication system.  \
cvsdist af3b546
#	       This script starts and stops krb524d, which converts \
cvsdist af3b546
#              Kerberos 5 credentials to Kerberos IV credentials.
cvsdist af3b546
# processname: krb524d
cvsdist af3b546
#
cvsdist af3b546
cvsdist af3b546
# Get config.
cvsdist af3b546
. /etc/sysconfig/network
cvsdist af3b546
cvsdist af3b546
# Check that networking is up.
cvsdist af3b546
[ ${NETWORKING} = "no" ] && exit 0
cvsdist af3b546
cvsdist af3b546
# Source function library.
cvsdist af3b546
. /etc/rc.d/init.d/functions
cvsdist af3b546
cvsdist af3b546
RETVAL=0
cvsdist 21f3145
prog="Kerberos 5-to-4 Server"
cvsdist 21f3145
krb524d=/usr/kerberos/sbin/krb524d
cvsdist af3b546
cvsdist 68d4ec4
# Shell functions to cut down on unnecessary shell invocations.
cvsdist af3b546
start() {
cvsdist af3b546
  	if [ ! -f /var/kerberos/krb5kdc/principal ] ; then
cvsdist af3b546
	    exit 0
cvsdist af3b546
	fi
cvsdist 21f3145
	echo -n $"Starting $prog: "
cvsdist 21f3145
	daemon ${krb524d} -m
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && touch /var/lock/subsys/krb524
cvsdist af3b546
}
cvsdist af3b546
stop() {
cvsdist 21f3145
	echo -n $"Stopping $prog: "
cvsdist 21f3145
	killproc ${krb524d}
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/krb524
cvsdist af3b546
}
cvsdist af3b546
cvsdist af3b546
# See how we were called.
cvsdist af3b546
case "$1" in
cvsdist af3b546
  start)
cvsdist af3b546
	start
cvsdist af3b546
	;;
cvsdist af3b546
  stop)
cvsdist af3b546
	stop
cvsdist af3b546
	;;
cvsdist af3b546
  restart)
cvsdist af3b546
	stop
cvsdist af3b546
	start
cvsdist af3b546
	;;
cvsdist af3b546
  status)
cvsdist 21f3145
	status ${krb524d}
cvsdist af3b546
	;;
cvsdist af3b546
  condrestart)
cvsdist af3b546
	if [ -f /var/lock/subsys/krb524 ] ; then
cvsdist af3b546
		stop
cvsdist af3b546
		start
cvsdist af3b546
	fi
cvsdist af3b546
	;;
cvsdist af3b546
  *)
cvsdist 0bb98ee
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
cvsdist af3b546
	RETVAL=1
cvsdist af3b546
	;;
cvsdist af3b546
esac
cvsdist af3b546
cvsdist af3b546
exit $RETVAL