#!/bin/sh
#
# ypserv:       Starts the yp-server
#
# Version:      @(#) /etc/rc.d/init.d/ypserv.init 1.0
#
# Author:       Joerg Mertin <smurphy@stargate.bln.sub.org>
#

# Source function library.
. /etc/rc.d/init.d/functions
# getting the YP-Domainname
. /etc/sysconfig/network

# See how we were called.
case "$1" in
  start)
	echo -n "Setting the domainname to: ${NIS_DOMAIN}"
	domainname ${NIS_DOMAIN}
	echo done
	echo -n "Starting YP server services: "
	daemon ypserv
	echo
	touch /var/lock/subsys/ypserv
	;;
  stop)
	echo -n "Stopping YP server services: "
	killproc ypserv
	rm -f /var/lock/subsys/ypserv
       echo
	;;
  *)
	echo "Usage: ypserv.init {start|stop}"
	exit 1
esac

exit 0

