From c73c61f37d5ba9e7d4bfaeb3b83414945db6cdc7 Mon Sep 17 00:00:00 2001 From: Meliox Date: Sun, 14 Sep 2025 16:59:45 +0200 Subject: [PATCH] fix false detection of ram and fans --- pve-mod-gui-sensors.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pve-mod-gui-sensors.sh b/pve-mod-gui-sensors.sh index b8c1885..c631b3c 100644 --- a/pve-mod-gui-sensors.sh +++ b/pve-mod-gui-sensors.sh @@ -200,7 +200,7 @@ function configure { #region ram setup msgb "\n=== Detecting RAM temperature sensors ===" local ramList=$(echo "$sanitisedSensorsOutput" | grep -o '"SODIMM[^"]*"' | sed 's/"//g' | paste -sd, -) - local ramCount=$(echo "$ramList" | tr ',' '\n' | wc -l) + local ramCount=$(grep -c '"SODIMM[^"]*"' <<<"$sanitisedSensorsOutput") if [ "$ramCount" -gt 0 ]; then info "Detected RAM sensors ($ramCount): $ramList" @@ -249,7 +249,7 @@ function configure { # Find all fan names that have fan*_input entries fanList=$(echo "$sanitisedSensorsOutput" | grep -B2 '"fan[0-9]\+_input"' | grep '".*": {' | sed 's/.*"\([^"]*\)": {.*/\1/' | sort -u | paste -sd, -) - fanCount=$(echo "$fanList" | tr ',' '\n' | wc -l) + fanCount=$(grep -c 'fan[0-9]\+_input' <<<"$sanitisedSensorsOutput") if [ "$fanCount" -gt 0 ]; then info "Detected fan speed sensors ($fanCount): $fanList"