Salome HOME
PR: ROOT_DIR to virtual link = APPLI directory
[modules/kernel.git] / bin / appliskel / killCurrentPort
1 #!/bin/bash
2
3 # --- retrieve APPLI path, relative to $HOME, set ${APPLI}
4
5 . `dirname $0`/setAppliPath.sh
6
7 # --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
8
9 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
10
11 # --- find omniORB configuration relative to current session if any
12
13 myhost=`hostname`
14 fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
15
16 if [ -f $fileOmniConfig ]; then
17   OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg
18   export OMNIORB_CONFIG
19 fi
20
21 currentPort=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
22 echo $currentPort
23
24 # --- kill current salome session
25
26 ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py $currentPort
27
28 # --- delete config files
29
30 if [ -s $fileOmniConfig ]; then
31   refConfig=`ls -l $fileOmniConfig | awk '{print \$NF}'`
32   if [ -f $refConfig ]; then
33     rm $refConfig
34   fi
35   rm $fileOmniConfig
36 fi