#	Startup script for WAMPES 
#
#ident "@(#)WAMPES	90/06/04"

USAGE="Usage: /etc/init.d/wampes {start | stop}"

if [ ! -d /tcp ]
then			# /tcp not mounted
	exit 
fi
case "$1" in
'start')

	# if [ -x /tcp/util/bridge ]
	# then
		# /tcp/util/bridge &
	# else
	#	 echo $0: /tcp/util/bridge not found >/dev/console
	# fi
	if [ -x /tcp/conversd ]
	then
		/tcp/conversd &
	else
		echo $0: /tcp/conversd not found >/dev/console
	fi
	;;

'stop')
 #	kill the bridge 
 	pid=`/bin/ps -ef 2>/dev/null | /bin/grep bridge | /bin/grep -v grep \
 			| /bin/sed -e 's/  *[a-z0-9]*  *//' -e 's/ .*//'`
 	if [ "${pid}" != "" ]
 	then
 		/bin/kill -9 ${pid}
 	fi
 #	kill conversd
 	pid=`/bin/ps -ef 2>/dev/null | /bin/grep conversd | /bin/grep -v grep \
 			| /bin/sed -e 's/  *[a-z0-9]*  *//' -e 's/ .*//'`
 	if [ "${pid}" != "" ]
 	then
		/bin/kill -9 ${pid}
	fi
	;;
*)
	echo ${USAGE}
	exit 1
	;;
esac
