3 # --- run command in SALOME environment from remote call, ssh or rsh
4 # - SALOME configuration is defined by :
5 # - list of MODULE_ROOT_DIR
6 # - prerequisite environment
7 # - specific configuration for a particular SALOME application
8 # - These elements of configuration are defined locally on each computer
9 # in the directory APPLI:
10 # - A SALOME application distributed on several computers needs APPLI
11 # directories on the same path ($APPLI) relative to $HOME directory
12 # of the user, on each computer.
14 # --- call example (from cli76cd to cli76ce):
15 # ssh cli76ce ${APPLI}/runRemote.sh cli76cd 2810 SALOME_Container myContainerName
18 # $0 : ${APPLI}/runRemote.sh: from arg name, rebuild and export $APPLI variable
19 # $1 : computer name for CORBA name service (where SALOME was launched)
20 # $2 : port for CORBA name service
21 # $3 and following : local command to execute, with args
24 # --- retrieve APPLI path, relative to $HOME
25 # on sarge, "which" gives not allways the absolute path...
29 if test x$aa == x\/; then
31 elif test x$aa == x\.; then
32 mycom=${PWD}/${comName:2}
34 mycom=${PWD}/${comName}
36 APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '`
40 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
42 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
44 # --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
46 export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
49 initref="NameService=corbaname::"$1":$2"
50 echo "ORBInitRef $initref" > $OMNIORB_CONFIG
52 # --- execute the command in the SALOME environment
56 ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile $HOME/$APPLI/.bashrc -c "$*"