diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2020-09-03 12:29:04 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2020-09-03 12:29:04 +0200 |
commit | 0e3e1674ae6d35ab6af29af96a6f24bfb9179078 (patch) | |
tree | ff80289ce51928db489abf74fef3251fb10a8230 /server/bin/setsmbpass | |
parent | 64e2155d0620c0fbbaa2827fe2edbf1c6cea135c (diff) |
#997: Support for Initrd compressed in several formats.
Adding compatibility with Ubuntu 20.04 Initrd, which is compressed in LZ4 format.
Diffstat (limited to 'server/bin/setsmbpass')
-rwxr-xr-x | server/bin/setsmbpass | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/bin/setsmbpass b/server/bin/setsmbpass index f681196b..4920d399 100755 --- a/server/bin/setsmbpass +++ b/server/bin/setsmbpass @@ -13,6 +13,9 @@ #@version 1.1.0 - Soporte para varios clientes ogLive. #@author Ramón M. Gómez - ETSII Univ. Sevilla #@date 2017-06-20 +#@version 1.2.0 - Soporte para varios compresores de Initrd. +#@author Ramón M. Gómez - ETSII Univ. Sevilla +#@date 2020-09-02 #*/ ## @@ -76,7 +79,8 @@ for OGLIVE in $LIST; do echo "Configurando cliente \"$OGLIVE\" ..." mkdir -p $TMPDIR cd $TMPDIR || ogRaiseError access "Directorio temporal" - gzip -dc "$CLIENTINITRD" | cpio -im + COMPRESS=$(file -b "$CLIENTINITRD" | awk '{print tolower($1);}') + $COMPRESS -dc "$CLIENTINITRD" | cpio -im if [ -f scripts/ogfunctions ]; then sed -i "s/OPTIONS=\(.*\)user=\w*\(.*\)pass=\w*\(.*\)/OPTIONS=\1user=$SAMBAUSER\2pass=$SAMBAPASS\3/" scripts/ogfunctions # TEMPORAL: solución ticket 554, actualizar cliente en caché (ogLive r3257). @@ -86,7 +90,7 @@ for OGLIVE in $LIST; do echo "$SAMBAPASS" > scripts/passrsync chown root.root scripts/passrsync chmod 400 scripts/passrsync - # Generar Initrd del cliente. + # Generar Initrd del cliente (siempre comprimido con gzip). find . | cpio -H newc -oa | gzip -9c > "$CLIENTINITRD" else echo "$PROG: Aviso: no se ha modificado la clave del cliente \"$OGLIVE\"." |