#!/bin/sh
if [ -f /usr/local/bin/detect ]; then
	detect=/usr/local/bin/detect
elif [ -f `dirname $0`/detect ]; then
	detect=`dirname $0`/detect
elif [ -f `dirname $0`/installer/detect ]; then
	detect=`dirname $0`/installer/detect
elif [ -f `dirname $0`/../installer/detect ]; then
	detect=`dirname $0`/../installer/detect
elif [ -f $HOME/detect ]; then
	detect=$HOME/detect
else
	echo "*** Missing detect script, please make sure the instance is complete and up to date."
	exit 1
fi
if [ -f /bin/bash -a "x$BASH_VERSION" = x ]; then
	/bin/bash $detect -as $0 $@
else
	. $detect
fi
