#!/bin/sh
#
# nfs           This shell script takes care of starting and stopping
#               the NFS services. Later we might add NIS too.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Damien Neil
#

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

# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
    exit 0
fi

. /etc/sysconfig/network

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

[ -f /usr/sbin/rpc.nfsd ] || exit 0
[ -f /usr/sbin/rpc.mountd ] || exit 0
[ -f /etc/exports ] || exit 0

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting NFS services: "
	daemon rpc.mountd
	daemon rpc.nfsd
	echo
	touch /var/lock/subsys/nfs
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down NFS services: "
	killproc rpc.mountd
	killproc rpc.nfsd
	echo
	rm -f /var/lock/subsys/nfs
	;;
  *)
	echo "Usage: nfs {start|stop}"
	exit 1
esac

exit 0

