Skip to content

Commit

Permalink
Minor improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerblue77 committed Feb 1, 2023
1 parent 857a3b3 commit f46a90c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dell_iDRAC_fan_controller.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

# Define global functions
apply_Dell_profile () {
function apply_Dell_profile () {
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x01 > /dev/null
CURRENT_FAN_CONTROL_PROFILE="Dell default dynamic fan control profile"
}

apply_user_profile () {
function apply_user_profile () {
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x00 > /dev/null
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x02 0xff $HEXADECIMAL_FAN_SPEED > /dev/null
CURRENT_FAN_CONTROL_PROFILE="User static fan control profile ($DECIMAL_FAN_SPEED%)"
}

# Prepare traps in case of container exit
gracefull_exit () {
function gracefull_exit () {
apply_Dell_profile
echo "/!\ WARNING /!\ Container stopped, Dell default dynamic fan control profile applied for safety."
exit 0
Expand Down Expand Up @@ -49,6 +49,7 @@ echo "CPU temperature treshold: $CPU_TEMPERATURE_TRESHOLD°C"
echo "Check interval: ${CHECK_INTERVAL}s"
echo ""

# Prepare required variables and constants
readonly TABLE_HEADER_PRINT_INTERVAL=10
i=$TABLE_HEADER_PRINT_INTERVAL
IS_DELL_PROFILE_APPLIED=true
Expand Down

0 comments on commit f46a90c

Please sign in to comment.