#!/bin/sh

VXIF_HOME=./;export VXIF_HOME
VXIF_ORIGENVLANG=$LANG;export VXIF_ORIGENVLANG
PERL_UNICODE=1;export PERL_UNICODE

# Get the Machine Type for the platform that we are running on
HDWR_TYPE=`uname -m`

# Use our own distribution of Perl (VRTSperl)
case `uname` in
	Linux)
                if [ $HDWR_TYPE = "x86_64" ] ; then
                        if [ -e "./RALUS64/uninstallrmal" ] ; then
                                cd ./RALUS64
                                ./uninstallrmal $*
                        else
                                echo "ERROR: Unable to launch Linux 64-bit uninstaller."
                        fi
                        exit 1
                fi 

		OS=Linux;export OS
		PERL_VER=5.8.8;export PERL_VER
		;;
	*)
		echo "Not Supported Yet."
		;;
esac

if [ -z "$VXIF_HOME" ] ; then
	echo "ERROR: Environment variable VXIF_HOME is not defined. Exiting ... "
	exit 1;
fi

if [ ! -d "${VXIF_HOME}/VxIF" ] ; then
	echo "ERROR: VXIF_HOME is invalid. It must point to the root of VxIF. Exiting ... "
	exit 1;
fi
perl -I.. -I$PATH -I$VXIF_HOME ./uninstallrmal.pl $*
