summaryrefslogtreecommitdiffstats
path: root/remote/modules/hardware-stats
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/hardware-stats')
-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