Rename JSON_FILE to DEBUG_JSON_FILE

This commit is contained in:
rmm 2024-06-23 11:51:37 +02:00
parent 3db6f5ce0c
commit 05c30a67f7

View File

@ -34,7 +34,7 @@ DEBUG_SAVE_FILENAME="sensorsdata.json"
# Only to be used to debug on other systems. Save the "sensor -j" output into a json file. # Only to be used to debug on other systems. Save the "sensor -j" output into a json file.
# Information will be loaded for script configuration and presented in Proxmox. # Information will be loaded for script configuration and presented in Proxmox.
DEBUG_REMOTE=false DEBUG_REMOTE=false
JSON_FILE="/tmp/sensordata.json" DEBUG_JSON_FILE="/tmp/sensordata.json"
# Helper functions # Helper functions
function msg { function msg {
@ -102,8 +102,8 @@ function configure {
local sensorsOutput local sensorsOutput
if [ $DEBUG_REMOTE = true ]; then if [ $DEBUG_REMOTE = true ]; then
warn "Remote debugging is used. Sensor readings from dump file $JSON_FILE will be used." warn "Remote debugging is used. Sensor readings from dump file $DEBUG_JSON_FILE will be used."
sensorsOutput=$(cat $JSON_FILE) sensorsOutput=$(cat $DEBUG_JSON_FILE)
else else
sensorsOutput=$(sensors -j) sensorsOutput=$(sensors -j)
fi fi
@ -303,7 +303,7 @@ function install_mod {
if [ $SENSORS_DETECTED = true ]; then if [ $SENSORS_DETECTED = true ]; then
local sensorsCmd local sensorsCmd
if [ $DEBUG_REMOTE = true ]; then if [ $DEBUG_REMOTE = true ]; then
sensorsCmd="cat \"$JSON_FILE\"" sensorsCmd="cat \"$DEBUG_JSON_FILE\""
else else
# WTF: sensors -f used for Fahrenheit breaks the fan speeds :| # WTF: sensors -f used for Fahrenheit breaks the fan speeds :|
#local sensorsCmd=$([[ "$TEMP_UNIT" = "F" ]] && echo "sensors -j -f" || echo "sensors -j") #local sensorsCmd=$([[ "$TEMP_UNIT" = "F" ]] && echo "sensors -j -f" || echo "sensors -j")