summaryrefslogtreecommitdiffstats
path: root/remote/modules/hardware-stats/data
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-01 14:25:33 +0200
committerroot2016-09-01 14:25:33 +0200
commit9feb645feedb66412408b9562ccac74d86f6f822 (patch)
treedceb8e5ae10ec3ea7c7a581e5140e4d4ae315cc6 /remote/modules/hardware-stats/data
parent[vmchooser2] Extend remote logging format (diff)
downloadtm-scripts-9feb645feedb66412408b9562ccac74d86f6f822.tar.gz
tm-scripts-9feb645feedb66412408b9562ccac74d86f6f822.tar.xz
tm-scripts-9feb645feedb66412408b9562ccac74d86f6f822.zip
[dmidecode] New module: Compile on our own so we support 'em all
The distro's dmidecode might be a little out of date and won't support all the latest hardware at all times.
Diffstat (limited to 'remote/modules/hardware-stats/data')
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats4
1 files changed, 2 insertions, 2 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 4227070f..5a776054 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
@@ -40,7 +40,7 @@ fi
MAC=${BOOTIF:3}
# 2) Get machine UUID, with fallback to MAC address if it fails for some reason
-UUID=$(dmidecode -q -s system-uuid | head -n 1)
+UUID=$(dmidecode -q -s system-uuid | grep -v '^#' | head -n 1)
if [ "${#UUID}" -ne "36" ]; then
echo "Determined UUID (${UUID}) has not expected length of 36, falling back to MAC..."
UUID="000000000000000-$BOOTIF"
@@ -143,7 +143,7 @@ fi
# A) Read system model and manufacturer
dmidec() {
- local LMODEL=$(dmidecode "$@" 2>/dev/null | grep -v '^Invalid' | sed 's/\s\s*/ /g;s/^ //;s/ $//')
+ local LMODEL=$(dmidecode "$@" 2>/dev/null | grep -v '^#' | grep -v '^Invalid' | sed 's/\s\s*/ /g;s/^ //;s/ $//')
case "$LMODEL" in
""|*"Product Name"*|*"be filled"*|"unknown"|*"product name"*)
LMODEL="Unknown"