Salome HOME
Apply button accepts the focus after last control in the Property panel. Controls...
[modules/shaper.git] / salome_run.sh
index ae238852a7c7cc8560662d2eafd431675fc57dbe..ce82805fa075cd3a18179f9322f5be290bfca2b7 100755 (executable)
@@ -1,20 +1,24 @@
-#!/bin/bash -e
+#!/bin/bash
 
-a_dir=$(dirname $0)
+source env.sh
+source ${TOOLS_DIR}/env_salome.sh
 
-if [ "$#" = 1 ]; then
-  export SALOME_PORT="$1"
-elif [ -z ${SALOME_PORT} ]; then
-  export SALOME_PORT=2900
-fi
+# kill processes of previous SALOME run
+if [ -f .salomeport ]; then
+  SALOME_PORT=$(cat .salomeport)
+  ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
+  pkill -f "omniNames -start ${SALOME_PORT}"
+  rm .salomeport
+fi 
 
-echo "Run SALOME on port ${SALOME_PORT}"
+SALOME_ARGS=""
+SALOME_ARGS="${SALOME_ARGS} -r ./test.squish/shared/testdata/SalomeApp.xml"
+SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
 
-source ${a_dir}/env.sh
-source ${a_dir}/env_salome.sh
+${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome
 
-set -x +e
+SALOME_PORT=$(cat .salomeport)
+echo "Kill SALOME on port ${SALOME_PORT}"
+${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
+pkill -f "omniNames -start ${SALOME_PORT}"
 
-${a_dir}/salome_kill.sh
-
-${KERNEL_ROOT_DIR}/bin/salome/runSalome.py --port=${SALOME_PORT} -r ./test.squish/shared/testdata/SalomeApp.xml 2>&1 >/dev/null