#!/sbin/sh
#
# nfs		This shell script takes care of starting and stopping
#		the NFS services. Later we might add NIS too.
#
# Version:	@(#) /sbin/init.d/nfs 1.01 26-Oct-1993
#
# Author:	Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#

  # Source function library.
  . /sbin/init.d/functions

  # See how we were called.
  case "$1" in
    start)
	# Start daemons.
	echo -n "Starting NFS services: "
	daemon /usr/sbin/rpc.portmap
	# Time for mapping the ports
	sleep 1
	daemon /usr/sbin/rpc.mountd -n
	daemon /usr/sbin/rpc.nfsd -n
	echo

	# Mount any NFS file systems.
	/bin/mount -a -tnfs > /var/adm/nfs.log 2>&1 &
	;;
    stop)
	echo -n "Shutting down NFS services: "
	killproc -TERM rpc.nfsd
	killproc -TERM rpc.mountd
	killproc -TERM rpc.portmap
	echo

	# Unmount any NFS file systems.
	/bin/umount -a -tnfs
	;;
    *)
	# Oops someone made a typo.
	echo "Usage: /sbin/init.d/nfs {start|stop}"
	exit 1
  esac

exit 0
