#!/bin/bash # # Useful shell to run executable progs or shells under Salome env # Use it with args to run a program : runSession python -i myprog.py # Use it without args to run an interactive shell under Salome env # APPLI_HOME=`dirname $0` # --- retrieve APPLI path, relative to $HOME, set ${APPLI} . ${APPLI_HOME}/setAppliPath.sh # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) . ${HOME}/${APPLI}/envd ${HOME}/${APPLI} # --- set omniORB configuration to current session if any myhost=`hostname` fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg if [ -f $fileOmniConfig ]; then OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg export OMNIORB_CONFIG # --- set environment variables for port and hostname of NamingService NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host` export NSHOST NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port` export NSPORT fi # --- invoke shell with or without args if [ $# -ne 0 ] ; then ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py $* else ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc fi