From 8a2b568dfb42283022a85d54eaeeea56c3d8b87c Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Thu, 21 Nov 2019 09:57:54 +0100 Subject: #920: Remove white spaces when obtaining the client serial number. --- client/engine/Inventory.lib | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') 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 -- cgit v1.2.3-18-g5258