diff --git a/call_host.sh b/call_host.sh index 743c2d8..1d3c240 100755 --- a/call_host.sh +++ b/call_host.sh @@ -19,8 +19,17 @@ if [ -z "$CALL_HOST_DIR" ]; then export CALL_HOST_STATUS=disable fi fi -export CALL_HOST_DIR=$(readlink -f "$CALL_HOST_DIR") -mkdir -p "$CALL_HOST_DIR" +CALL_HOST_DIR_ORIG="$CALL_HOST_DIR" +export CALL_HOST_DIR=$(readlink -f "$CALL_HOST_DIR_ORIG") +if [ -z "$CALL_HOST_DIR" ]; then + echo "Warning: readlink -f failed for CALL_HOST_DIR $CALL_HOST_DIR_ORIG. disabling" + export CALL_HOST_STATUS=disable +elif [ ! -d "$CALL_HOST_DIR" ]; then + echo "Warning: specified dir CALL_HOST_DIR $CALL_HOST_DIR does not exist. disabling" + export CALL_HOST_STATUS=disable +else + mkdir -p "$CALL_HOST_DIR" +fi # ensure the pipe dir is bound export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${CALL_HOST_DIR}