#!/bin/sh

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

# Let's get the type of Machine we are running on this platform
HDWR_TYPE=`uname -m`

# Use our own distribution of Perl
case `uname` in
	Linux)
		if [ $HDWR_TYPE = "x86_64" ] ; then
			if [ -e "./RALUS64/installrmal" ] ; then
				cd ./RALUS64
				./installrmal $*
			else
				echo "ERROR: Unable to launch Linux 64-bit installer."
			fi
			exit 1
		fi
		;;
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 ./installrmal.pl $*
