Created
June 24, 2020 02:41
-
-
Save wcypierre/ca8dd5c58230ee3255a1a2f3cdfacb9b to your computer and use it in GitHub Desktop.
Revisions
-
wcypierre created this gist
Jun 24, 2020 .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,32 @@ #!/bin/bash # # crontab -l > mycron # echo "#" >> mycron # echo "# At every 2nd minute" >> mycron # echo "*/2 * * * * /bin/bash /scripts/dell_ipmi_fan_control.sh >> /tmp/cron.log" >> mycron # crontab mycron # rm mycron # chmod +x /scripts/dell_ipmi_fan_control.sh # DATE=$(date +%Y-%m-%d-%H%M%S) echo "" && echo "" && echo "" && echo "" && echo "" echo "$DATE" # STATICSPEEDBASE16="0x0f" SENSORNAME="Inlet Temp" TEMPTHRESHOLD="38" # T=$(/scratch/ipmitool sdr type temperature | grep $SENSORNAME | cut -d"|" -f5 | cut -d" " -f2) echo "$IDRACIP: -- current temperature --" echo "$T" # if [[ $T > $TEMPTHRESHOLD ]] then echo "--> enable dynamic fan control" /scratch/ipmitool raw 0x30 0x30 0x01 0x01 else echo "--> disable dynamic fan control" /scratch/ipmitool raw 0x30 0x30 0x01 0x00 echo "--> set static fan speed" /scratch/ipmitool raw 0x30 0x30 0x02 0xff $STATICSPEEDBASE16 fi