From 5b3d84fb733a6f02dde7c092e34963eb8ead8c0e Mon Sep 17 00:00:00 2001 From: Meliox Date: Sat, 6 Sep 2025 08:17:46 +0200 Subject: [PATCH] sanitise nan --- pve-mod-gui-sensors.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve-mod-gui-sensors.sh b/pve-mod-gui-sensors.sh index 31db6ee..dccad39 100644 --- a/pve-mod-gui-sensors.sh +++ b/pve-mod-gui-sensors.sh @@ -332,7 +332,7 @@ function install_mod { #local sensorsCmd=$([[ "$TEMP_UNIT" = "F" ]] && echo "sensors -j -f" || echo "sensors -j") sensorsCmd="sensors -j 2>/dev/null | python3 -m json.tool" fi - sed -i '/my \$dinfo = df('\''\/'\'', 1);/i\'$'\t''$res->{sensorsOutput} = `'"$sensorsCmd"'`;\n\t# sanitize JSON output\n\t$res->{sensorsOutput} =~ s/ERROR:.+\\s(\\w+):\\s(.+)/\\"$1\\": 0.000,/g;\n\t$res->{sensorsOutput} =~ s/ERROR:.+\\s(\\w+)!/\\"$1\\": 0.000,/g;\n\t$res->{sensorsOutput} =~ s/,\s*(\})/$1/g;\n' "$NODES_PM_FILE" + sed -i '/my \$dinfo = df('\''\/'\'', 1);/i\'$'\t''$res->{sensorsOutput} = `'"$sensorsCmd"'`;\n\t# sanitize JSON output\n\t$res->{sensorsOutput} =~ s/ERROR:.+\\s(\\w+):\\s(.+)/\\"$1\\": 0.000,/g;\n\t$res->{sensorsOutput} =~ s/ERROR:.+\\s(\\w+)!/\\"$1\\": 0.000,/g;\n\t$res->{sensorsOutput} =~ s/,\\s*(\})/$1/g;\n\t$res->{sensorsOutput} =~ s/\\bNaN\\b/null/g;\n' "$NODES_PM_FILE" msg "Sensors' output added to \"$NODES_PM_FILE\"." fi