Return model info for non-Pi devices

This commit is contained in:
billz 2020-05-27 08:31:54 +01:00
parent 8c6f0bd5fc
commit 7410b45c05
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ function RPiVersion()
if (array_key_exists($rev, $revisions)) {
return $revisions[$rev];
} else {
return 'Unknown Pi';
exec('cat /proc/device-tree/model', $model);
if (isset($model[0])) {
return $model[0];
} else {
return 'Unknown Device';
}
}
}