@echo off
rem ********************************************************************************
rem *
rem * RAIDINFO.BAT
rem *
rem * This file writes information about supported RAID controllers to a file
rem * on the RAMDSK, named RAIDINFO.TXT.   This file contains all the information
rem * available about the discovered RAID controllers in a given target system.
rem *
rem * This batch file is called by the user.
rem *
rem ********************************************************************************

rem * Verify we have space to write the output file.
if "%RAMDSK%"=="" goto error


rem * Clear the screen and display banner
call stkhder.bat

rem * Clean-up from any previous run
if exist %RAMDSK%\raidinfo.txt del %RAMDSK%\raidinfo.txt > nul


rem ********************************************************************************
rem * Determine if there are any IBM ServeRAID adapters found - max=16
rem ********************************************************************************
set NM_SR=0

rem ********************************************************************************
rem *    Hardware detect will determine the following:
rem *    NM_SR  Number of IBM ServeRAID 4H, 4Lx, 4Mx, 5i, 6i, 6i+, 6M, 7k
rem *    NM_TT  Number of IBM ServeRAID t-type
rem *    NM_EA  Number of IBM ServeRAID e-type SATA
rem *    NM_ES  Number of IBM ServeRAID e-type SCSI
rem *    NM_IS  Number of LSI-1020, LSI-1030
rem *    NM_ID  Number of LSI IDEal RAID
rem ********************************************************************************
echo Scanning for supported RAID controllers.
call hwdet.bat


rem *******************************************************************************
rem Displayed to the screen
rem *******************************************************************************
echo The following RAID controllers have been found:
echo Number of IBM ServeRAID 4H, 4Lx, 4Mx, 5i, 6i, 6i+, 6M, 7k = %NM_SR%
echo Number of IBM ServeRAID t-type                            = %NM_TT%
echo Number of IBM ServeRAID e-type SATA                       = %NM_EA%
echo Number of IBM ServeRAID e-type SCSI                       = %NM_ES%
echo Number of LSI-1020, LSI-1030                              = %NM_IS%
echo Number of LSI IDEal RAID                                  = %NM_ID%
echo.
rem *******************************************************************************

rem *******************************************************************************
rem Pipe to the file
rem *******************************************************************************
echo The following RAID controllers have been found:                         >> %RAMDSK%\raidinfo.txt
echo Number of IBM ServeRAID 4H, 4Lx, 4Mx, 5i, 6i, 6i+, 6M, 7k  = %NM_SR%    >> %RAMDSK%\raidinfo.txt
echo Number of IBM ServeRAID t-type                             = %NM_TT%    >> %RAMDSK%\raidinfo.txt
echo Number of IBM ServeRAID e-type SATA                        = %NM_EA%    >> %RAMDSK%\raidinfo.txt
echo Number of IBM ServeRAID e-type SCSI                        = %NM_ES%    >> %RAMDSK%\raidinfo.txt
echo Number of LSI-1020, LSI-1030                               = %NM_IS%    >> %RAMDSK%\raidinfo.txt
echo Number of LSI IDEal RAID                                   = %NM_ID%    >> %RAMDSK%\raidinfo.txt
echo.                                                                        >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************


rem ********************************************************************************
rem * Attempt to load DOS device driver for IBM ServeRAID since one or more is found
rem ********************************************************************************
if not %NM_SR%==0 call loadraid.bat



:GETSR
rem ********************************************************************************
rem *    IBM ServeRAID 4H, 4Lx, 4Mx, 5i, 6i, 6i+, 6M, 7k
rem ********************************************************************************
if %NM_SR%==0 goto GETTT

rem *******************************************************************************
rem Pipe to the file:  IPSSEND Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * IBM ServeRAID 4H, 4Lx, 4Mx, 5i, 6i, 6i+, 6M, 7k                             *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  IPSSEND.EXE   *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        ipsnd1.bat                     *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg1.bat                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

if %NM_SR%==16 goto S16
if %NM_SR%==15 goto S15
if %NM_SR%==14 goto S14
if %NM_SR%==13 goto S13
if %NM_SR%==12 goto S12
if %NM_SR%==11 goto S11
if %NM_SR%==10 goto S10
if %NM_SR%==9  goto S9
if %NM_SR%==8  goto S8
if %NM_SR%==7  goto S7
if %NM_SR%==6  goto S6
if %NM_SR%==5  goto S5
if %NM_SR%==4  goto S4
if %NM_SR%==3  goto S3
if %NM_SR%==2  goto S2
if %NM_SR%==1  goto S1

:S16
IPSSEND GETCONFIG 16 >> %RAMDSK%\raidinfo.txt
:S15
IPSSEND GETCONFIG 15 >> %RAMDSK%\raidinfo.txt
:S14
IPSSEND GETCONFIG 14 >> %RAMDSK%\raidinfo.txt
:S13
IPSSEND GETCONFIG 13 >> %RAMDSK%\raidinfo.txt
:S12
IPSSEND GETCONFIG 12 >> %RAMDSK%\raidinfo.txt
:S11
IPSSEND GETCONFIG 11 >> %RAMDSK%\raidinfo.txt
:S10
IPSSEND GETCONFIG 10 >> %RAMDSK%\raidinfo.txt
:S9
IPSSEND GETCONFIG 9  >> %RAMDSK%\raidinfo.txt
:S8
IPSSEND GETCONFIG 8  >> %RAMDSK%\raidinfo.txt
:S7
IPSSEND GETCONFIG 7  >> %RAMDSK%\raidinfo.txt
:S6
IPSSEND GETCONFIG 6  >> %RAMDSK%\raidinfo.txt
:S5
IPSSEND GETCONFIG 5  >> %RAMDSK%\raidinfo.txt
:S4
IPSSEND GETCONFIG 4  >> %RAMDSK%\raidinfo.txt
:S3
IPSSEND GETCONFIG 3  >> %RAMDSK%\raidinfo.txt
:S2
IPSSEND GETCONFIG 2  >> %RAMDSK%\raidinfo.txt
:S1
IPSSEND GETCONFIG 1  >> %RAMDSK%\raidinfo.txt


rem ********************************************************************************
rem *    %NM_TT%  Number of IBM ServeRAID t-type
rem ********************************************************************************

:GETTT
IF %NM_TT%==0 GOTO GETEA

rem *******************************************************************************
rem Pipe to the file:  ACU Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * IBM ServeRAID t-type                                                        *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  ACU.EXE       *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        acu1.txt                       *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg1.txt                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

if %NM_TT%==16 goto T16
if %NM_TT%==15 goto T15
if %NM_TT%==14 goto T14
if %NM_TT%==13 goto T13
if %NM_TT%==12 goto T12
if %NM_TT%==11 goto T11
if %NM_TT%==10 goto T10
if %NM_TT%==9  goto T9
if %NM_TT%==8  goto T8
if %NM_TT%==7  goto T7
if %NM_TT%==6  goto T6
if %NM_TT%==5  goto T5
if %NM_TT%==4  goto T4
if %NM_TT%==3  goto T3
if %NM_TT%==2  goto T2
if %NM_TT%==1  goto T1

rem *** Information can not be sent directly to the main information file.

:T16
ACU /R%RAMDSK%\TTYPE.out  /C15 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 15:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T15
ACU /R%RAMDSK%\TTYPE.out  /C14 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 14:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T14
ACU /R%RAMDSK%\TTYPE.out  /C13 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 13:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T13
ACU /R%RAMDSK%\TTYPE.out  /C12 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 12:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T12
ACU /R%RAMDSK%\TTYPE.out  /C11 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 11:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T11
ACU /R%RAMDSK%\TTYPE.out  /C10 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 10:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T10
ACU /R%RAMDSK%\TTYPE.out  /C9 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 9:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T9
ACU /R%RAMDSK%\TTYPE.out  /C8 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 8:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T8
ACU /R%RAMDSK%\TTYPE.out  /C7 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 7:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T7
ACU /R%RAMDSK%\TTYPE.out  /C6 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 6:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T6
ACU /R%RAMDSK%\TTYPE.out  /C5 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 5:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T5
ACU /R%RAMDSK%\TTYPE.out  /C4 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 4:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T4
ACU /R%RAMDSK%\TTYPE.out  /C3 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 3:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T3
ACU /R%RAMDSK%\TTYPE.out  /C2 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 2:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T2
ACU /R%RAMDSK%\TTYPE.out  /C1 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 1:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt
:T1
acu /DC0 /C0 /S
ACU /R%RAMDSK%\TTYPE.out  /C0 > TT.out
rem * Re-direct the output to the main information file
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
echo Information for Controller 0:     >> %RAMDSK%\raidinfo.txt
echo -------------------------------------------------------------------------------   >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TTYPE.out                >> %RAMDSK%\raidinfo.txt
type %RAMDSK%\TT.out                   >> %RAMDSK%\raidinfo.txt
echo.                                  >> %RAMDSK%\raidinfo.txt



rem * Clean up the temporary files
if exist %RAMDSK%\TTYPE.out del %RAMDSK%\TTYPE.out > nul
if exist %RAMDSK%\TT.out    del %RAMDSK%\TT.out > nul

rem ********************************************************************************
rem *    IBM ServeRAID e-type SATA
rem ********************************************************************************
:GETEA

if %NM_EA%==0 GOTO GETES

rem *******************************************************************************
rem Pipe to the file:  ACUICHSV Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * IBM ServeRAID e-type SATA                                                   *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  ACUICHSV.EXE  *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        acusv1.txt                     *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg2.txt                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

ACUICHSV LISTMB >> %RAMDSK%\raidinfo.txt

rem ********************************************************************************
rem *    IBM ServeRAID e-type SCSI
rem ********************************************************************************
:GETES

IF %NM_ES%==0 GOTO GETISR

rem *******************************************************************************
rem Pipe to the file:  RAIDSEL Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * IBM ServeRAID e-type SCSI                                                   *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  RAIDSEL.EXE   *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        rdsel1.bat                     *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg2.bat                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

RAIDSEL -L physical >> %RAMDSK%\raidinfo.txt


rem ********************************************************************************
rem *    LSI-1020 & LSI-1030
rem ********************************************************************************
:GETISR

IF %NM_IS%==0 GOTO GETIDE

rem *******************************************************************************
rem Pipe to the file:  CFG1030 Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * LSI-1020, LSI-1030                                                          *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  CFG1030.EXE   *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        c10301.bat                     *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg3.bat                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

COPY %TK_PATH%\utils\cfg1030.exe %RAMDSK% >nul
%RAMDSK%

IF %NM_IS%==1 GOTO IS1

:IS2
CFG1030 GETCONFIG 2 >> %RAMDSK%\raidinfo.txt

:IS1
CFG1030 GETCONFIG 1 >> %RAMDSK%\raidinfo.txt

rem * go back to the main Toolkit drive
%TKDRV%



:GETIDE
rem ********************************************************************************
rem *    %NM_ID%  Number of LSI IDEal RAID
rem ********************************************************************************

IF %NM_ID%==0 GOTO END

rem *******************************************************************************
rem Pipe to the file:  HYPERCFG Banner information:
rem *******************************************************************************
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * LSI IDEal RAID                                                              *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo * This type of RAID controller uses the following DOS utility:  HYPERCFG.EXE  *   >> %RAMDSK%\raidinfo.txt
echo *                                                                             *   >> %RAMDSK%\raidinfo.txt
echo * The following IBM ServerGuide Scripting Toolkit sample RAID configuration   *   >> %RAMDSK%\raidinfo.txt
echo * files can be used as a base for customization to configure this type of     *   >> %RAMDSK%\raidinfo.txt
echo * of RAID controller:                                                         *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\examples\raid        hyper1.bat                     *   >> %RAMDSK%\raidinfo.txt
echo * or                                                                          *   >> %RAMDSK%\raidinfo.txt
echo *       ...\sgdeploy\sgtk\altiris\raid         rdcfg4.bat                     *   >> %RAMDSK%\raidinfo.txt
echo *******************************************************************************   >> %RAMDSK%\raidinfo.txt
echo.                                                                                  >> %RAMDSK%\raidinfo.txt
rem *******************************************************************************

echo LSI IDEal RAID is enabled.                                                        >> %RAMDSK%\raidinfo.txt
echo The ServerGuide Scipting Toolkit sample RAID configuration file for this type     >> %RAMDSK%\raidinfo.txt
echo of RAID controller allows for the customization of the RAID array variable.       >> %RAMDSK%\raidinfo.txt
echo Edit the same RAID configuration file to set the RAID array variable to the       >> %RAMDSK%\raidinfo.txt
echo value.                                                                            >> %RAMDSK%\raidinfo.txt

goto END




:ERROR
rem ********************************************************************************
rem * Hit an error in this batch file.
rem ********************************************************************************
echo The RAMDSK environment variable is not set. Therefore, there is no space
echo available where the output file can be written.   Verify a RAM drive is being
echo loaded and the RAMDSK environment variable is being set to its value. 
echo.
echo Encountered an error and stopped processing in "raidinfo.bat".


:END
echo.
echo Scan complete.   Scan results stored in %RAMDSK%\raidinfo.txt.

if not %DPLY_TYPE%==4 goto CLEANUP

%TKDRV%\logevent.exe -c:2 -l:2 -ss:"RAIDINFO:  View the file sgdeploy\sgtk\altiris\temp\%AID%\raidinfo.txt."

md %TK_PATH%\altiris\temp\%AID% > nul
copy %RAMDSK%\raidinfo.txt %TK_PATH%\altiris\temp\%AID% > nul

echo Updating Altiris status: Good
%TKDRV%\logevent.exe -c:0 -l:1 -ss:"RAIDINFO: Completed successfully."

rem Reset to root of Toolkit drive
%TKDRV%
cd \

:CLEANUP
set NM_SR=
set NM_TT=
set NM_EA=
set NM_ES=
set NM_IS=
set NM_ID=
