Salome HOME
This commit was generated by cvs2git to create branch 'OCC_Config'.
[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   export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
23
24   # --- set environment variables for port and hostname of NamingService
25
26   export NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
27   export NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
28 fi
29
30 # --- invoque shell with or without args
31
32 if [ $# -ne 0 ] ; then
33     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -c "$*"
34 else
35
36     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
37 fi