Created
October 7, 2021 12:09
-
-
Save imfht/c3ca6ce1d1b6daa6e063947061aa22e3 to your computer and use it in GitHub Desktop.
Revisions
-
imfht created this gist
Oct 7, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/bin/sh ipmi_host=idrac ipmi_user=root ipmi_passwd=xxxx temp_threshold="60" get_value=`ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd sensor reading "Temp" | cut -d "|" -f 2 | cut -d " " -f 2` if [[ $get_value > $temp_threshold ]] then ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x01 0x01 echo "set fans auto " else ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x01 0x00 ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x02 0xff 0x0a echo "set fans 1000" fi