diff options
| author | Simon Rettberg | 2016-01-05 10:32:19 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2016-01-05 10:32:19 +0100 |
| commit | 3d17d02b4994f26f2221d3f3fb439d2573f52d8f (patch) | |
| tree | e056d8219af9def8e62b7aee1d143a93cfe45999 /remote/modules/hardware-stats/data | |
| parent | [hardware-stats] Fix+improve system model detection (diff) | |
| download | tm-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/modules/hardware-stats/data')
| -rwxr-xr-x | remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 4 |
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" |
