Salome HOME
[PythonAPI / doc] doc updates, using google style docstrings
[modules/shaper.git] / salome_run.sh
index cb4f8255ccddaed8719029f72b789bcc9eaa1887..ce82805fa075cd3a18179f9322f5be290bfca2b7 100755 (executable)
@@ -1,15 +1,24 @@
-#!/bin/bash -ex
-
-if [ "$#" = 1 ]; then
-  export SALOME_PORT="$1"
-else
-  export SALOME_PORT=2900
-fi
+#!/bin/bash
 
 source env.sh
-source env_salome.sh
+source ${TOOLS_DIR}/env_salome.sh
 
+# 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 
+
+SALOME_ARGS=""
+SALOME_ARGS="${SALOME_ARGS} -r ./test.squish/shared/testdata/SalomeApp.xml"
+SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport"
+
+${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome
+
+SALOME_PORT=$(cat .salomeport)
+echo "Kill SALOME on port ${SALOME_PORT}"
 ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
-${KERNEL_ROOT_DIR}/bin/salome/runSalome.py --port=${SALOME_PORT} -r ./test.squish/shared/testdata/SalomeApp.xml
-sleep 5
-${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT}
+pkill -f "omniNames -start ${SALOME_PORT}"
+