Created
August 6, 2020 22:32
-
-
Save noslin005/ca15e82d4c812be96b1cd31d8871a6a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Counting HBA SAS3 controllers ..." | |
sas_ctrl=$(sas3flash -listall | grep -e "^[0-9]"| awk '{print $1}') | |
output="/tmp/sas.txt" | |
for ctrl in ${sas_ctrl[@]}; do | |
ctrl_index=$(echo $ctrl | awk '{print $1}') | |
echo "Controller ${ctrl_index}: Identifying Model and Firmware ID" | |
sas3flash -c ${ctrl_index} -list > $output | |
model=$(awk '/Board Name/ {print $4}' $output) | |
firmware_mode=$(awk '/Firmware Product ID/ {print $6}' $output | tr -d '()') | |
echo "Controller ${ctrl_index}: Model = $model" | |
echo "Controller ${ctrl_index}: Firmware Mode = $firmware_mode" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment