3 # Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
4 # PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # --- run command in SALOME environment from remote call, ssh or rsh
23 # - SALOME configuration is defined by :
24 # - list of MODULE_ROOT_DIR
25 # - prerequisite environment
26 # - specific configuration for a particular SALOME application
27 # - These elements of configuration are defined locally on each computer
28 # in the directory APPLI:
29 # - A SALOME application distributed on several computers needs APPLI
30 # directories on the same path ($APPLI) relative to $HOME directory
31 # of the user, on each computer.
33 # --- call example (from cli76cd to cli76ce):
34 # ssh cli76ce ${APPLI}/runRemote.sh cli76cd 2810 SALOME_Container myContainerName
37 # $0 : ${APPLI}/runRemote.sh: from arg name, rebuild and export $APPLI variable
38 # $1 : computer name for CORBA name service (where SALOME was launched)
39 # $2 : port for CORBA name service
40 # $3 and following : local command to execute, with args
43 # --- retrieve APPLI path, relative to $HOME, set ${APPLI}
45 . `dirname $0`/setAppliPath.sh
47 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
49 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
51 # --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
53 OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
59 initref="NameService=corbaname::"$1":$2"
60 echo "ORBInitRef $initref" > $OMNIORB_CONFIG
62 # --- execute the command in the SALOME environment
66 ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile $HOME/$APPLI/.bashrc -c "$*"