From f46a90cfe40b7a2066880dafec9e658e48c15368 Mon Sep 17 00:00:00 2001 From: Tigerblue77 <37409593+tigerblue77@users.noreply.github.com> Date: Wed, 1 Feb 2023 22:07:15 +0100 Subject: [PATCH] Minor improvments --- Dell_iDRAC_fan_controller.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index 0bab993..fca44b2 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -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 @@ -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