#!/bin/sh
#clear
#echo Starting in `pwd`

#set -x

PATH=../../../daemon:../../../coss/naming:../../../imr:../../../ir:../../../idl:../../../cpp:$PATH
export PATH
ADDR=inet:`uname -n`:12456
IRADDR=inet:`uname -n`:12500
NSDADDR=inet:`uname -n`:12501
BANK=inet:`uname -n`:13000
PERSON=inet:`uname -n`:13001

MICOINC=$MICODIR/include

IDLPAR="-I$MICOINC"

printf "Starting IRD ..."
ird --db=ir-db -ORBIIOPAddr $IRADDR 2>/dev/null &
ird_pid=$!
sleep 2
echo $ird_pid > ird.pid
echo done.

if [ ! -f ir-db.idl ]
then

printf "Send ir_base.idl to IR ..."
idl $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/ir_base.idl
echo "done."

printf "Send ir.idl to IR ..."
idl $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/ir.idl
echo "done."

printf "Send CosObjectIdentity.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosObjectIdentity.idl
echo "done."

printf "Send CosRelationships.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosRelationships.idl
echo "done."

printf "Send CosGraphs.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosGraphs.idl
echo "done."

printf "Send CosNaming.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosNaming.idl
echo "done."

printf "Send CosLifeCycle.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosLifeCycle.idl
echo "done."

printf "Send CosExternalization.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosExternalization.idl
echo "done."

printf "Send CosContainment.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosContainment.idl
echo "done."

printf "Send CosReference.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosReference.idl
echo "done."

printf "Send CosExternalizationContainment.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosExternalizationContainment.idl
echo "done."

printf "Send CosExternalizationReference.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/CosExternalizationReference.idl
echo "done."

printf "Send Documents.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir Documents.idl
echo "done."

printf "Send Test.idl to IR ..."
idl  $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir Test.idl
echo "done."

fi


