#
# NAME:
#
#   	svcuninstall.sh installs all the TrueType fonts
#
# SYNOPSIS:	
#
#	svcuninstall.sh NeXT_root_directory major_version minor_version 
#				Windows_root_directory
#
#
# DESCRIPTION:
#
#	svcuninstall.sh is a Bourne shell script used to 
#	install the machd and nmserver services into the registry.
#
#  EXAMPLES:
#
#	>svcuninstall.sh $(NEXT_ROOT)
#

# Check arguments 
case $# in
	1 )
		;;
	* )
		echo "svcuninstall.sh : usage";
		echo "      svcuninstall.sh NeXT_root_directory";
		exit 1;;
esac
echo "Number of parameters okay"

PATH=$1/NextLibrary/Executables\;$PATH
export PATH
echo $PATH

MACHD_EXE=$1/NextLibrary/System/machd.exe
NMSERVER_EXE=$1/NextLibrary/System/nmserver.exe

sleep 2
# Check Next root directory
if test ! -d $1
then
	echo "svcuninstall : invalid NeXT root directory" $1
	exit 1
fi
echo "Next Root okay"

if test ! -f $MACHD_EXE
then
	echo "svcuninstall : Can't find machd" $MACHD_EXE
	exit 1
fi
echo "machd okay"

if test ! -f $NMSERVER_EXE
then
	echo "svcuninstall : Can't find nmserver" $NMSERVER_EXE
	exit 1
fi
echo "nmserver okay"


$NMSERVER_EXE -remove
$MACHD_EXE -remove
