From 908030cf9d07c2be0c738ede86f3652d0250790a Mon Sep 17 00:00:00 2001 From: Meliox Date: Sun, 14 Sep 2025 11:55:40 +0200 Subject: [PATCH] rework save-sensors-data to provide raw and sanitied output --- pve-mod-gui-sensors.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pve-mod-gui-sensors.sh b/pve-mod-gui-sensors.sh index 59ee394..64e47c0 100644 --- a/pve-mod-gui-sensors.sh +++ b/pve-mod-gui-sensors.sh @@ -134,6 +134,8 @@ function configure { # Apply lm-sensors sanitization sensorsOutput=$(sanitize_sensors_output "$sensorsOutput") + echo $sensorsOutput + if [ $? -ne 0 ]; then err "Sensor output error.\n\nCommand output:\n${sensorsOutput}\n\nExiting..." fi @@ -1625,7 +1627,13 @@ function save_sensors_data { local choiceContinue=$(ask "Do you wish to continue? (Y/n)") case "$choiceContinue" in [yY]|"") - sensors -j 2>/dev/null | python3 -m json.tool >"$filepath" + echo "lm-sensors raw output:" >"$filepath" + sensorsOutput=$(sensors -j 2>/dev/null) + echo "$sensorsOutput" >>"$filepath" + echo -e "\n\nSanitised lm-sensors output:" >>"$filepath" + # Apply lm-sensors sanitization + sanitisedSensorsOutput=$(sanitize_sensors_output "$sensorsOutput") + echo "$sanitisedSensorsOutput" >>"$filepath" info "Sensors data saved in $filepath." ;; *)