#!/bin/sh
# IFe_radiance
# if no /tmp/DAR directory and default file create...
if test ! -d /tmp/def_rad ; then
  mkdir /tmp/def_rad
fi
if test ! -d /tmp/def_rad/rad ; then
  mkdir /tmp/def_rad/rad
fi
chmod a+w /tmp/def_rad
chmod a+w /tmp/def_rad/*
chmod a+w /tmp/def_rad/rad
if test ! -f /tmp/RAD/default.cfg ; then
  cp -r ${IFE_HOME}/misc/def_rad /tmp
fi

# first see if radiance desktop is available on this machine, if
# so then run it otherwise show an image
# << need to show e2r application + a pic file >>
if test ! -f ${IFE_HOME}/sys/bin/e2r ; then
	echo    "emulation	radiance	${IFE_HOME}/lib/images/radiance.ex"
	${IFE_HOME}/sys/bin/vww -ex ${IFE_HOME}/lib/images/radiance.ex
	exit 0
fi

cd /tmp/def_rad
echo	"changed to /tmp/def_rad to work on radiance model"

${IFE_HOME}/sys/bin/e2r -file $1
exit 0
