]> SALOME platform Git repositories - modules/kernel.git/blob - bin/appliskel/runRemote.sh
Salome HOME
PR: ROOT_DIR to virtual link = APPLI directory
[modules/kernel.git] / bin / appliskel / runRemote.sh
1 #!/bin/bash
2
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.
9
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.
14
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
18
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20
21 #
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.
32 #
33 # --- call example (from cli76cd to cli76ce):
34 # ssh cli76ce ${APPLI}/runRemote.sh cli76cd 2810 SALOME_Container myContainerName
35 #
36 # --- local arguments
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
41 #
42
43 # --- retrieve APPLI path, relative to $HOME, set ${APPLI}
44
45 . `dirname $0`/setAppliPath.sh
46
47 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
48
49 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
50
51 # --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
52
53 OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
54 export OMNIORB_CONFIG
55 NSHOST=$1
56 export NSHOST
57 NSPORT=$2
58 export NSPORT
59 initref="NameService=corbaname::"$1":$2"
60 echo "ORBInitRef $initref" > $OMNIORB_CONFIG
61
62 # --- execute the command in the SALOME environment
63
64 shift 2
65
66 ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile $HOME/$APPLI/.bashrc -c "$*"