@echo off
REM #     cfgamt.cmd  - script to configure AMT firmware
REM #
set amtip=10.243.42.235
set amtgwy=10.243.42.251
set amtdns=10.127.1.11
set amtdom=intel.com
set amtname=aspenhill1
set oldpsw=admin
set newpsw=Password~2
REM set logfile=%DeploymentStore%\cfgamt.log
set logfile=\cfgamt.log
set ADDLOG=call addLogRecord
REM set ADDLOG=echo
set RET=0

REM # init the logfile
set parms=echo %logfile%
echo cfgamt start >%logfile%
if errorlevel 1 goto amterror

set parms=-I %amtip% -G %amtgwy% -P %amtdns% -N %amtdom% -H %amtname%
amtcfg %parms% -o %oldpsw% -p %newpsw% >>%logfile% 2>&1
if errorlevel 1 goto amterror
 %ADDLOG% AMTCFG INFO "Success: amtcfg %parms%"
 goto amtdone
:amterror
 set RET=%ERRORLEVEL%
 %ADDLOG% AMTCFG ERROR "Error %ERRORLEVEL%: amtcfg %parms%"
:amtdone
echo amtcfg %parms% done, ret=%RET%
exit /B %RET%