summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-05 10:04:36 +0100
committerSimon Rettberg2016-01-05 10:04:36 +0100
commitf7c97e46ecb4e9a9ed00d4aed5e0e3191e59ef90 (patch)
tree224936755a4c9126db5ea9fd376c6774c61d3200 /remote
parent[setup_target] Fix cleaning kernel if symlinked to different module name than... (diff)
downloadtm-scripts-f7c97e46ecb4e9a9ed00d4aed5e0e3191e59ef90.tar.gz
tm-scripts-f7c97e46ecb4e9a9ed00d4aed5e0e3191e59ef90.tar.xz
tm-scripts-f7c97e46ecb4e9a9ed00d4aed5e0e3191e59ef90.zip
[hardware-stats] Fix+improve system model detection
Diffstat (limited to 'remote')
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats27
1 files changed, 17 insertions, 10 deletions
diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index 81db23a4..f1538c1a 100755
--- a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -125,16 +125,23 @@ if which smartctl; then
fi
# A) Read system model and manufacturer
-MODEL=$(dmidecode -s system-product-name)
-case "$MODEL" in
- |System Product Name|*be filled*)
- MODEL="Unknown"
- ;;
- *)
- MANUF=$(dmidecode -s system-manufacturer)
- ;;
-esac
-if [ -n "$MANUF" ]; then
+dmidec() {
+ local MODEL=$(dmidecode "$@")
+ case "$MODEL" in
+ ""|*"Product Name"*|*"be filled"*|"unknown"|*"product name"*)
+ MODEL="Unknown"
+ ;;
+ esac
+ echo "$MODEL"
+}
+MODEL=$(dmidec -s system-product-name)
+# Try fallback to baseboard
+if [ "$MODEL" = "Unknown" ]; then
+ MODEL=$(dmidec -s baseboard-product-name)
+fi
+MANUF=$(dmidec -s baseboard-manufacturer)
+
+if [ "$MANUF" != "Unknown" ]; then
MODEL="$MODEL ($MANUF)"
fi