cp sysprep.inf sysprep.inf.orig
sed "
s/\r//
s/ComputerName=.*/ComputerName=$HOSTNAME/
s/IPAddress=.*/IPAddress=$IP/
s/DefaultGateway=.*/DefaultGateway=$GW/
s/SubnetMask=.*/SubnetMask=$DNS1,$DNS2/
s/\$/\r/
" sysprep.inf.orig > sysprep.inf
# sed:
# Remove CR from each line in the file
# Replace ComputerName= with ComputerName=$HOSTNAME (substitute whatever HOSTNAME is equal to)
# Do the same for IPAddress, DefaultGateway, and SubnetMask
# Replace the CR at the end of each line
|