#!/bin/bash

################################################################################
################################################################################
# Copyright 2023-2025 by NI SP Software GmbH, All rights reserved.
# Copyright 1999-2023 by Nice, srl., All rights reserved.
#
# This software includes confidential and proprietary information
# of NI SP Software GmbH ("Confidential Information").
# You shall not disclose such Confidential Information
# and shall use it only in accordance with the terms of
# the license agreement you entered into with NI SP Software.
################################################################################
################################################################################
################################################################################

################################################################################
# SVN $Id: common 40715 2016-12-08 00:31:56Z luca $
#
# Author: Antonio Arena
#         support@ni-sp-software.com
################################################################################


#-------------------------------------------------------------------------------
# Avoid recursive loops
#-------------------------------------------------------------------------------
[ -n "$EF_DO_NOT_RECURSE" ] && exit 0

EF_DO_NOT_RECURSE=true
export EF_DO_NOT_RECURSE


EF_PLUGIN_NAME="EnginFrame System Plug-in"
export EF_PLUGIN_NAME

EF_PLUGIN_FILE="EFSystem"
export EF_PLUGIN_FILE

EF_PLUGIN_ROOT="${EF_ROOT}/plugins/ef"
export EF_PLUGIN_ROOT


#-------------------------------------------------------------------------------
# Load common EnginFrame functions and environment
#-------------------------------------------------------------------------------
EF_FUNCTIONS="${EF_ROOT}/plugins/ef/lib/functions"
if [ ! -f "${EF_FUNCTIONS}" ]; then
    echo '<ef:error>'
    echo "  <ef:title><![CDATA[${EF_PLUGIN_NAME} Error]]></ef:title>"
    echo "  <ef:message><![CDATA[${EF_FUNCTIONS} is missing]]></ef:message>"
    echo "  <ef:command><![CDATA[${0//${EF_ROOT}/EF_ROOT}]]></ef:command>"
    echo '</ef:error>'
    exit 1
fi

. ${EF_FUNCTIONS}

ef_init_environment "$@"
