Moving functions to function.sh and avoiding redeclaration in the loop
This commit is contained in:
parent
a495ad796b
commit
2c44eadc82
2 changed files with 4 additions and 6 deletions
|
|
@ -95,12 +95,6 @@ while true; do
|
||||||
|
|
||||||
retrieve_temperatures $IS_EXHAUST_TEMPERATURE_SENSOR_PRESENT $IS_CPU2_TEMPERATURE_SENSOR_PRESENT
|
retrieve_temperatures $IS_EXHAUST_TEMPERATURE_SENSOR_PRESENT $IS_CPU2_TEMPERATURE_SENSOR_PRESENT
|
||||||
|
|
||||||
# Define functions to check if CPU 1 and CPU 2 temperatures are above the threshold
|
|
||||||
function CPU1_OVERHEAT() { [ $CPU1_TEMPERATURE -gt $CPU_TEMPERATURE_THRESHOLD ]; }
|
|
||||||
if $IS_CPU2_TEMPERATURE_SENSOR_PRESENT; then
|
|
||||||
function CPU2_OVERHEAT() { [ $CPU2_TEMPERATURE -gt $CPU_TEMPERATURE_THRESHOLD ]; }
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize a variable to store the comments displayed when the fan control profile changed
|
# Initialize a variable to store the comments displayed when the fan control profile changed
|
||||||
COMMENT=" -"
|
COMMENT=" -"
|
||||||
# Check if CPU 1 is overheating then apply Dell default dynamic fan control profile if true
|
# Check if CPU 1 is overheating then apply Dell default dynamic fan control profile if true
|
||||||
|
|
|
||||||
|
|
@ -114,3 +114,7 @@ function get_Dell_server_model() {
|
||||||
SERVER_MODEL=$(echo "$IPMI_FRU_content" | tr -s ' ' | grep "Board Product :" | awk -F ': ' '{print $2}')
|
SERVER_MODEL=$(echo "$IPMI_FRU_content" | tr -s ' ' | grep "Board Product :" | awk -F ': ' '{print $2}')
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Define functions to check if CPU 1 and CPU 2 temperatures are above the threshold
|
||||||
|
function CPU1_OVERHEAT() { [ $CPU1_TEMPERATURE -gt $CPU_TEMPERATURE_THRESHOLD ]; }
|
||||||
|
function CPU2_OVERHEAT() { [ $CPU2_TEMPERATURE -gt $CPU_TEMPERATURE_THRESHOLD ]; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue