#! /bin/sh -f
#############################################################
#############################################################
#
# Starting the CorbaWeb environment.
#
#############################################################
#############################################################

#############################################################
# Test the CorbaWeb environment.
#############################################################

if test "${CW_BINDIR}" = ""
then
  echo The CW_BINDIR shell variable must be set!
  echo "e.g.:"
  echo "      CW_BINDIR=/path_to_CorbaWeb_binaries"
  echo "      export CW_BINDIR"
  return
fi

#############################################################
# Source the CorbaWeb configuration.
#############################################################

. ${CW_BINDIR}/envi.CorbaWeb.sh

#############################################################
# Start the CorbaWeb HTTP Server.
#############################################################

if test -f ${CW_PID_FILE}
then
  echo Warning, the CorbaWeb HTTP Server is already started!
else
  echo The CorbaWeb HTTP Server will be started.
  CSPATH=${CW_ROOTDIR}/servlet:${CSPATH}
  cssh ${CS_HOMEDIR}/CorbaWeb/bin/CorbaWebHTTPServer.cs -p ${CW_HTTP_PORT} -h ${CW_HTTP_HOST} -rootdir ${CW_ROOTDIR} -pidfile ${CW_PID_FILE} $1 $2 $3 $4 $5 $6 $7 $8 $9 &
fi

#############################################################
# End of the 'CorbaWeb/bin/corbaweb_start' script.
#############################################################
