#920: Remove white spaces when obtaining the client serial number.

configfile
Ramón M. Gómez 2019-11-21 09:57:54 +01:00
parent 5db5a8b2ba
commit 8a2b568dfb
1 changed files with 2 additions and 1 deletions

View File

@ -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