Salome HOME
446ee605acc0f341ac639a0c6fbaf52da1bebc3c
[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 export APPLI=`${APPLI_HOME}/getAppliPath.py`
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 fileOmniConfig=${HOME}/${APPLI}/.omniORB_last.cfg
21
22 if [ -f $fileOmniConfig ]; then
23   OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_last.cfg
24   export OMNIORB_CONFIG
25
26   # --- set environment variables for port and hostname of NamingService
27
28   NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
29   export NSHOST
30   NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
31   export NSPORT
32 fi
33
34 # --- invoke shell with or without args
35
36 if [ $# -ne 0 ] ; then
37     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py $*
38 else
39
40     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
41 fi