Salome HOME
PR: merge from branch BR_auto_V310 tag mergefrom_OCC_development_for_3_2_0a2_10mar06
[modules/kernel.git] / bin / appliskel / runSession
1 #!/bin/bash
2 #
3 # Useful shell to run executable progs or shells under Salome env
4 # Use it with args to run a program : runSession python -i myprog.py
5 # Use it without args to run an interactive shell under Salome env
6 #
7
8 # --- retrieve APPLI path, relative to $HOME, set ${APPLI}
9
10 . `dirname $0`/setAppliPath.sh
11
12 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
13
14 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
15
16 # --- set omniORB configuration to current session if any
17
18 myhost=`hostname`
19 fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
20
21 if [ -f $fileOmniConfig ]; then
22   OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
23   export OMNIORB_CONFIG
24
25   # --- set environment variables for port and hostname of NamingService
26
27   NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
28   export NSHOST
29   NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
30   export NSPORT
31 fi
32
33 # --- invoque shell with or without args
34
35 if [ $# -ne 0 ] ; then
36     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile ${HOME}/${APPLI}/.bashrc -c "$*"
37 else
38
39     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile ${HOME}/${APPLI}/.bashrc
40 fi