#!/bin/sh
#
#    Copyright (c) 2007 Brocade Communications Systems, Inc.
#    All rights reserved.
#
#    Initialization script to start/stop nfsd.
#

# Source common library
. /etc/init.d/functions

NFSD=/usr/sbin/rpc.nfsd
NFS_NUM=4

MOUNTD=/usr/sbin/rpc.mountd

EXPORTFS=/usr/sbin/exportfs
EXPFLAG=-a

case "$1" in
'start')
    ${KILLALL} nfsd
    if test -x $NFSD; then
       $NFSD $NFS_NUM
       $ECHO " nfsd\c"
    fi
    if test -x $MOUNTD; then
       $MOUNTD
       $ECHO "mountd\c"
    fi
    if test -x $EXPORTFS; then
       $EXPORTFS $EXPFLAG
       $ECHO " exportfs\c"
    fi
    $ECHO "."
    ;;
'stop')
    ${KILLALL} nfsd
    ${KILLALL} rpc.mountd
    ;;
*)
    echo "usage: $0 {start | stop}"
    ;;
esac
