#!/bin/bash
-# Copyright (C) 2021 CEA/DEN, EDF R&D
+# Copyright (C) 2021-2023 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# ssh cli76ce ${APPLI}/runRemoteSSL.sh IOR_OF_CURSTOM_NS SALOME_Container myContainerName
# --- local arguments
# $0 : ${APPLI}/runRemote.sh: from arg name, rebuild and export $APPLI variable
+# --noenvd : optional argument. If present, the envd file is NOT sourced.
# $1 : IOR_OF_CURSTOM_NS of reference to Engines::EmbeddedNamingService servant
# $2 : WORKINGDIR (if $2 == WORKINDIR a working dir is given in $3. If not the working dir is $HOME)
# $3 : if $2 == WORKINGDIR, the path to the workingdir
# Sourcing files with parameters works with bash, not with dash. This is why
# we must use bash for this script.
-. "${HOME}/${APPLI}/envd" "${HOME}/${APPLI}"
-
-# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
-export CUSTOM_NS_IOR=$1
+if [ "$1" == "--noenvd" ]
+then
+ shift
+else
+ . "${HOME}/${APPLI}/envd" "${HOME}/${APPLI}"
+fi
#go to the requested working directory if any
if test "x$2" == "xWORKINGDIR"; then
# --- execute the command in the SALOME environment
-"${KERNEL_ROOT_DIR}/bin/salome/envSalome.py" /bin/sh -c "$* $CUSTOM_NS_IOR"
+"${KERNEL_ROOT_DIR}/bin/salome/envSalome.py" /bin/sh -c "$* "