Created
February 10, 2020 05:02
-
-
Save classilla/8eca8881683f3547369b55990cee4166 to your computer and use it in GitHub Desktop.
BitBar and Argos-compatible shell script for getting system fan information over IPMI.
This file contains 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 | |
IPMITOOL=/usr/bin/ipmitool | |
AWK=/usr/bin/awk | |
output=`$IPMITOOL sdr type fan | $AWK '{if($5=="ok")print $9}'` | |
echo -n $output | $AWK 'BEGIN{RS=" ";k=0} {if($1>k)k=$1} END{print k"rpm"}' | |
echo "---" | |
echo -n $output | $AWK 'BEGIN{RS=" ";ORS="rpm\n"} {if($1>0)print}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment