From 944d87bb8d5c8ff1f8efe35a04f468fa2c8e8a7c Mon Sep 17 00:00:00 2001 From: Meliox Date: Tue, 9 Jun 2026 23:17:14 +0200 Subject: [PATCH] fix validate the sensors -j output before proceeding --- src/Scripts/pve-mod-configure | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Scripts/pve-mod-configure b/src/Scripts/pve-mod-configure index 9911fb5..47e8b8a 100644 --- a/src/Scripts/pve-mod-configure +++ b/src/Scripts/pve-mod-configure @@ -120,12 +120,26 @@ configure_node_info() { fi if [[ "$lm_sensors_ok" == true ]]; then - local sensorsOutput sanitisedSensorsOutput + local sensorsOutput if [[ "$DEBUG_LM_SENSORS" -eq 1 ]]; then sensorsOutput=$(cat "$DEBUG_LM_SENSORS_FILE") else sensorsOutput=$(sensors -j 2>/dev/null) fi + + local trimmedSensorsOutput + trimmedSensorsOutput=$(echo "$sensorsOutput" | tr -d '[:space:]') + if [[ -z "$trimmedSensorsOutput" || "$trimmedSensorsOutput" == "{}" ]]; then + warn "lm-sensors is installed but reported no sensors." + warn "No kernel sensor drivers appear to be loaded." + warn "Run 'sensors-detect' and load the suggested modules, then re-run this configurator." + lm_sensors_ok=false + LM_SENSORS_ENABLED=0 + fi + fi + + if [[ "$lm_sensors_ok" == true ]]; then + local sanitisedSensorsOutput sanitisedSensorsOutput=$(sanitize_sensors_output "$sensorsOutput") #region CPU