#!/bin/sh
# RE_SID: @(%)/net/vodka/files11/snc32/en/p106646-03.rpc.pcnfsd.sparc/unix/pcnfsvr/pkg/SCCS/s.pcnfs 1.4 99/09/21 16:29:43 SMI

#
# Copyright (c) 1994, by Sun Microsystems, Inc.
#
#

if [ ! -d /usr/bin ]
then			# /usr not mounted
	exit
fi

killproc() {		# kill the named process(es)
	pid=`/usr/bin/ps -ef | /usr/bin/grep $1 |
		/usr/bin/grep -v grep | /usr/bin/grep -v /bin/sh |
		/usr/bin/awk '{print $2}'`

	if [ "${pid}" != "" ] ; then
		echo $2
		kill -TERM ${pid} > /dev/null 2>&1
	fi
}



# Start/stop PC-NFS daemons

case "$1" in
'start')

	#
	# start pcnfs authentication server and print services
	#
	if [ -f /opt/SUNWpcnfs/sbin/rpc.pcnfsd ] ; then
		echo "Starting PC-NFS authentication server and print services."
		/opt/SUNWpcnfs/sbin/rpc.pcnfsd &
	fi
	;;

'stop')

	killproc rpc.pcnfsd "Stopping PC-NFS authentication server and print services."
	;;
*)
	echo "Usage: /etc/init.d/pcnfs { start | stop }"
	;;
esac
exit 0
