#!/bin/bash choice=Current while getopts "d" opt; do case $opt in d) choice=Dev esac done echo "$choice is set as the preferred repo." # Determine Platform Manufacturer Platform=$(dmidecode -t system |grep -i Man |awk '{print substr($2,1,1)}') if [ "$Platform" = "D" ] then echo "System identified as a Dell branded server. Downloading and launching Dell System Update. This may take some time." sleep 5 # Download DSU wget http://rax.mirror.rackspace.com/media/DriversFirmware/Dell_Updates/remote_update/SYSMAN/dsu.BIN chmod +x dsu.BIN ./dsu.BIN -q #Run DSU against $choice repo dsu -n -u -d --source-location=http://rax.mirror.rackspace.com/media/DriversFirmware/Dell_Updates/remote_update/$choice --source-type=REPOSITORY --output-log-file=/var/log/dsu.log --ignore-signature echo "System updates have completed. Results are logged to /var/log/dsu.log. Please reboot to enable any firmware updates." sleep 5 # elif [ "$Platform" = "H" ] then echo "System identified as an HPE branded server. Downloading HPSUM and executing HPE Smart Update. This may take some time." sleep 5 mkdir ~/hpsum mkdir ~/hpsum/$choice cd ~/hpsum # Download hpsum wget http://rax.mirror.rackspace.com/media/DriversFirmware/HPE_Updates/remote_update/sum.zip unzip sum.zip cd sum # Add localhost to list of nodes ./smartupdate add --nodes localhost # Add HPE $choice baseline ./smartupdate add --baselines type=http save_location=~/hpsum/$choice bundle=http://rax.mirror.rackspace.com/media/DriversFirmware/HPE_Updates/remote_update/$choice/bp.xml # Compare local to remote repo ./smartupdate inventory --nodes localhost --baselines ~/hpsum/$choice # Update local to desired firmware levels ./smartupdate deploy --nodes localhost # Generate Reports ./smartupdate generatereports --nodes localhost echo "System Updates complete. Logs generated in the ~/hpsum/sum folder. Please reboot for any new firmware to take effect." sleep 5 fi