#REM  This script generates the initial SETs
#REM  for configuring a MASTER.CFG for Non-Interactive Mode.

#REM   NI_FRUSDR FRU SDR NI_POWER AC_PSM  BMC_TAM TAM_AAS NI_FRU NI_ASSET
#REM                             DC_PSM           TAM_DMS
#REM                                              TAM_AMS
#REM                                              TAM_DAS
#REM  See MASTER.CFG for brief descriptions.

echoSETs() (
    echo SET \"$chassis\"
    for i in $* ;
    do
        echo SET \"$i\"
    done
)


if [ $# -ge 1 ]
then
  chassis=$1
else
  chassis=`queryProperty FRU "Chassis OEM Field" -`
fi

# -----  Generate  MASTER.CFG settings for each chassis type below
        FRUCFG_SETS=
        [ "$chassis" = "SR2500LX" ] && FRUCFG_SETS="SR2500LX"
        [ "$chassis" = "TIGH2U" ]   && FRUCFG_SETS="NI_FRUSDR FRU SDR NI_POWER AC_PSM  BMC_TAM TAM_AAS NI_FRU NI_ASSET"
        [ "$chassis" = "NSC2U" ]    && FRUCFG_SETS="NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET"
        [ "$chassis" = "NSN2U" ]    && FRUCFG_SETS="NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET"
        [ "$chassis" = "NSW1U" ]    && FRUCFG_SETS="NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET"
        [ "$chassis" = "TIGW1U" ]   && FRUCFG_SETS="NI_FRUSDR FRU SDR NI_POWER AC_PSM  BMC_TAM TAM_AAS NI_FRU NI_ASSET"
        if [ "$FRUCFG_SETS" = "" ]
        then
            echo "ERROR chassis $chassis not recognized."
            addLogRecord FRUSDR ERROR "ERROR chassis $chassis  is not recognized."
        else
            echoSETs $FRUCFG_SETS
            addLogRecord FRUSDR INFO "MASTER.CFG SETS: $FRUCFG_SETS"
            addLogRecord FRUSDR INFO "MASTER.CFG generated for $chassis."
        fi




