-if [ "$#" = 1 ]; then
- export SALOME_PORT="$1"
-elif [ -z ${SALOME_PORT} ]; then
- export SALOME_PORT=2900
-fi
-
-echo "Run SALOME on port ${SALOME_PORT}"
+# 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