#!/bin/sh

. /etc/rc.conf

case $1 in
autostart)
	test x"${nfsd:-NO}" = x"NO" && exit 0
	exec $0 start
	;;
start)
	mkdir -p /var/lib/nfs
	/usr/sbin/rpc.mountd -r
	/usr/sbin/rpc.nfsd
	;;
stop)
	killall rpc.nfsd
	killall rpc.mountd
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?
