Merge branch 'master' of github.com:webmin/webmin

This commit is contained in:
Jamie Cameron
2020-11-18 23:47:08 -08:00

View File

@@ -500,6 +500,7 @@ if (&has_command("sensors")) {
my $fh = "SENSORS";
my $aa;
my $ab;
my $ac;
&open_execute_command($fh, "sensors </dev/null 2>/dev/null", 1);
while(<$fh>) {
if (/Core\s+(\d+):\s+([\+\-][0-9\.]+)/) {
@@ -522,7 +523,7 @@ if (&has_command("sensors")) {
if ($aa && /temp(\d+):\s+([\+\-][0-9\.]+)\s+.*?[=+].*?\)/) {
# Adjust to start from `0` as all other outputs
push(@rvx, { 'core' => (int($1) - 1),
'temp' => $2 });
'temp' => $2 });
}
# New line - new device
@@ -531,10 +532,20 @@ if (&has_command("sensors")) {
$ab = 1 if (/cpu_thermal-virtual-[\d]+/i);
# Get odd output like in #1280
if ($ab && /temp(\d+):\s+([\+\-][0-9\.]+)/) {
push(@rvx, { 'core' => $1,
'temp' => $2 });
}
push(@rvx, { 'core' => $1,
'temp' => $2 });
}
# AMD Ryzen oddness
$ac = 0 if (/^\s*$/);
# Check for CPU
$ac = 1 if (/[\d]+temp-pci/i);
# Get odd output like in #discussion/600155
if ($ac && /Tdie:\s+([\+\-][0-9\.]+)/) {
push(@rvx, { 'core' => 0,
'temp' => $1 });
}
}
}
close($fh);
}