# This is coded against iLO4!
# Run as root
cd /var/tmp # or where ever you would like to have your temporary files
#
# Get the current configuration
#
hponcfg --writeconfig ilo
#
# Delete the directory information and user information portions of the xml file.
#
sed -i '/^ <DIR_INFO/,/^ <\/DIR_INFO/d' ilo
sed -i '/^ <USER_INFO/,/^ <\/USER_INFO/d' ilo
#
# Compute your new ip address. Note, OCT4 is based on RHEL 7 type OS using eth0 as the NIC.
# Adjust as needed.
#
BASE_IP=11.11.11.
OCT4=$(ifconfig eth0 | grep inet | awk '{ print $2 }' | cut -d. -f4)
#
# You will probably also want to change the netmask and default gateway.
# The netmask can be found at: SUBNET_MASK
# and the gateway at: GATEWAY_IP_ADDRESS
# Change accordingly.
#
sed -i "s|^\( <IP_ADDRESS VALUE = \"\).*|\1${BASE_IP}${OCT4}\"/>|" ilo
#
# Write the new ip to the iLO
#
hponcfg --file ilo