Salome HOME
PR: ROOT_DIR to virtual link = APPLI directory
[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 APPLI_HOME=`dirname $0`
9
10 # --- retrieve APPLI path, relative to $HOME, set ${APPLI}
11
12 . ${APPLI_HOME}/setAppliPath.sh
13
14 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
15
16 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
17
18 # --- set omniORB configuration to current session if any
19
20 myhost=`hostname`
21 fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
22
23 if [ -f $fileOmniConfig ]; then
24   OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
25   export OMNIORB_CONFIG
26
27   # --- set environment variables for port and hostname of NamingService
28
29   NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
30   export NSHOST
31   NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
32   export NSPORT
33 fi
34
35 # --- invoke shell with or without args
36
37 if [ $# -ne 0 ] ; then
38     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py $*
39 else
40
41     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
42 fi