@echo off
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.

set chassis=%1
if "%chassis%" == "" (
    call queryProperty FRU  "Chassis OEM Field"  - | varSet chassis > nul
    call exportvarSet chassis
)

goto do%chassis%
echo %ERRORLEVEL%
if %ERRORLEVEL% GEQ 0 (
    echo ERROR chassis %chassis%  is not recognized.
    call addLogRecord FRUSDR ERROR "ERROR chassis %chassis%  is not recognized."
    GOTO done
)
call addLogRecord FRUSDR INFO "MASTER.CFG generated for %chassis% ."
goto :done

REM -----  Generate  MASTER.CFG settings for each chassis type below

:doTIGH2U
call :echoSETs NI_FRUSDR FRU SDR NI_POWER AC_PSM  BMC_TAM TAM_AAS NI_FRU NI_ASSET
goto done

:doNSC2U
call :echoSETs NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET
goto done

:doNSN2U
call :echoSETs NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET
goto done

:doNSW1U
call :echoSETs NI_FRUSDR FRU SDR NI_POWER AC_PSM  NI_FRU NI_ASSET
goto done

:doTIGW1U
call :echoSETs NI_FRUSDR FRU SDR NI_POWER AC_PSM  BMC_TAM TAM_AAS NI_FRU NI_ASSET
goto done

:doSR2500LX
REM DO NOTHING
goto done


:echoSETs
    call addLogRecord FRUSDR INFO "MASTER.CFG SETS: %*"
    echo SET "%chassis%"
    FOR %%i IN (%*) DO call :SETTHIS %%i
    goto :EOF

:SETTHIS
    echo SET "%1"
    goto :EOF


:done





