Skip to content

Commit

Permalink
Dashboard: Hardware info is empty NethServer#4--dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
markVnl committed Oct 19, 2016
1 parent 2885f20 commit 982c0d5
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ private function readCPU()
$ret++;
}
}
$tmp = explode(':',$f[4]);

foreach ($f as $linenumber => $line) {
if (strpos($line, 'model name') !== false) {
$linemumber++;
break;
}
}
$tmp = explode(':',$f[$linenumber]);

return array('model' => trim($tmp[1]), 'n' => $ret);
}
Expand All @@ -100,6 +107,8 @@ private function readDMI($id)
{
if (file_exists("/sys/devices/virtual/dmi/id/$id")) {
return file_get_contents("/sys/devices/virtual/dmi/id/$id");
} elseif (file_exists("/etc/nethserver/arm/id/$id")) {
return file_get_contents("/etc/nethserver/arm/id/$id");
} else {
return "-";
}
Expand Down

0 comments on commit 982c0d5

Please sign in to comment.