summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-11-21 09:57:54 +0100
committerRamón M. Gómez <ramongomez@us.es>2019-11-21 09:57:54 +0100
commit8a2b568dfb42283022a85d54eaeeea56c3d8b87c (patch)
treebcf5786b48960d252bfe6227db73341f799cdccb
parent5db5a8b2ba0525f13b76b01108583c543e33a1e9 (diff)
#920: Remove white spaces when obtaining the client serial number.
-rwxr-xr-xclient/engine/Inventory.lib3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/engine/Inventory.lib b/client/engine/Inventory.lib
index f3a779d7..92b46ef4 100755
--- a/client/engine/Inventory.lib
+++ b/client/engine/Inventory.lib
@@ -109,7 +109,8 @@ fi
# Obtener nº de serie (ignorar los no especificados).
SERIALNO=$(dmidecode -s system-serial-number | egrep -vi "(^[ 0]+$|not specified|to be filled|invalid entry|default string)")
-# Truncar cadena si >25 caracteres.
+# Quitar espacios y truncar cadena si >25 caracteres.
+SERIALNO="${SERIALNO// /}"
[ ${#SERIALNO} -gt 25 ] && SERIALNO="${SERIALNO:0:22}..."
[ -n "$SERIALNO" ] && echo "$SERIALNO"
return 0