summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-05 10:32:19 +0100
committerSimon Rettberg2016-01-05 10:32:19 +0100
commit3d17d02b4994f26f2221d3f3fb439d2573f52d8f (patch)
treee056d8219af9def8e62b7aee1d143a93cfe45999 /remote
parent[hardware-stats] Fix+improve system model detection (diff)
downloadtm-scripts-3d17d02b4994f26f2221d3f3fb439d2573f52d8f.tar.gz
tm-scripts-3d17d02b4994f26f2221d3f3fb439d2573f52d8f.tar.xz
tm-scripts-3d17d02b4994f26f2221d3f3fb439d2573f52d8f.zip
[hardware-stats] Sanitize spaces in cpu and system model
Diffstat (limited to 'remote')
-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 f1538c1a..686bb444 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
@@ -49,7 +49,7 @@ if [ -z "$CPUCORES" ] || [ "$CPUCORES" = "0" ]; then
fi
# 5) CPU model name
-CPUMODEL=$(grep -m1 '^model name\s*:' /proc/cpuinfo | sed 's/^model name\s*:\s*//')
+CPUMODEL=$(grep -m1 '^model name\s*:' /proc/cpuinfo | sed 's/^model name\s*:\s*//;s/\s\s*/ /g;s/^ //;s/ $//')
# 6) RAM
RAM=$(grep '^MemTotal:' /proc/meminfo | awk '{print $2}')
@@ -126,7 +126,7 @@ fi
# A) Read system model and manufacturer
dmidec() {
- local MODEL=$(dmidecode "$@")
+ local MODEL=$(dmidecode "$@" | sed 's/\s\s*/ /g;s/^ //;s/ $//')
case "$MODEL" in
""|*"Product Name"*|*"be filled"*|"unknown"|*"product name"*)
MODEL="Unknown"