I'm trying to make a MS-DOS batch file automatically update the firmware on up to 12 HBA cards. (The site has a closet full of HBA's that need updating and this would speed up the process) I've successfully completed the part to select which model to upgrade, but it's been too long to remember how to set up the part where the user inputs how many cards are in the system.
In the command line of DOSLPCFG download n=1 i=zd282a4.all The n= is where the card number would be so it would run n=1, then loop to n=2, etc until it reaches the user defined number of cards. Initially I created a var called %HBANUM% and I found the portion of the script regarding this on line, but I am missing something or this is not what I need. Where the (??) is where I need something to specify the input range (Currently in=1 is hardcoded so I could work on the portion dealing with card type selection which I am fully aware may also be done incorrectly for this type of batch file.)
The CONFIRM section simply runs a command to list the HBA's after everything is complete to confirm all cards are at the same firmware level. This part works fine.
Any assistance would be appreciated, even if just pointing me in the right direction. I can't learn anything if it's all done for me.
Thanks
Joe
REM *****HBA firmware upgrade batch file *****
:BEGIN
cls
echo.
echo.
echo EMULEX HBA FIRMWARE UPGRADE UTILITY
echo.
echo This utility will upgrade the firmware on the Emulex LPE11000
echo (single port) and LPE11002 (Dual port) PCI-E HBA cards
echo.
echo You can upgrade up to 12 HBA's at one time.
echo.
echo All HBA's MUST be the same type (single or dual)
echo.
echo Otherwise the upgrade will fail on the cards not specified to be
echo upgraded.
echo.
echo Select HBA Type:
echo.
echo 1=LPE11000 (Single Port)
echo 2=LPE11002 (Dual Port)
strings HBATYPE = ASK Model of card to upgrade:
IF %HBATYPE%== 1 GOTO LPE11000
IF %HBATYPE%== 2 GOTO LPE11002
IF %HBATYPE%== "" GOTO ERROR
REM var HBANUM = ASK How many HBA's are installed?:
REM @echo off
REM set HBANUM=0
REM:start
REM if %HBANUM%== (??) goto CONFIRM
REM echo %HBANUM%
REM set /HBANUM +=1
REM goto start
REM:end
:LPE11000
DOSLPCFG download n=1 i=zd282a4.all
:LPE11002
DOSLPCFG download n=1 i=zf282a4.all
pause
:ERROR
echo Invalid entry. Try again
GOTO BEGIN
:CONFIRM
cls
echo.
DOSLPCFG listhba
echo.
echo Confirm firmware version in all above listed HBA's
:END