refs #2772 adds sudo to cpio in setsmbpass

pull/23/head
Luis Gerardo Romero Garcia 2025-09-11 13:55:19 +02:00
parent f166b9650d
commit 321c86a7c3
1 changed files with 4 additions and 4 deletions

View File

@ -68,19 +68,19 @@ for OGLIVE in $LIST; do
echo "Verificar si el archivo es gzip, lz4 o ASCII cpio antes de descomprimir"
if file "$CLIENTINITRD" | grep -q "gzip compressed data"; then
if ! gzip -dc "$CLIENTINITRD" | cpio -im; then
if ! gzip -dc "$CLIENTINITRD" | sudo cpio -im; then
echo "Error: No se pudo descomprimir y extraer $CLIENTINITRD con gzip."
exit 4
fi
COMPRESS_CMD="gzip -9c"
elif file "$CLIENTINITRD" | grep -q "LZ4 compressed data"; then
if ! lz4 -d "$CLIENTINITRD" | cpio -im; then
if ! lz4 -d "$CLIENTINITRD" | sudo cpio -im; then
echo "Error: No se pudo descomprimir y extraer $CLIENTINITRD con lz4."
exit 4
fi
COMPRESS_CMD="lz4 -c"
elif file "$CLIENTINITRD" | grep -q "ASCII cpio archive"; then
if ! cpio -im < "$CLIENTINITRD"; then
if ! sudo cpio -im < "$CLIENTINITRD"; then
echo "Error: No se pudo extraer $CLIENTINITRD como archivo cpio."
exit 4
fi
@ -94,7 +94,7 @@ for OGLIVE in $LIST; do
sudo 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).
sudo sed -i "s/busybox reboot/reboot/" scripts/ogfunctions
find . | cpio -H newc -oa | gzip -9c > "$CLIENTINITRD"
find . | sudo cpio -H newc -oa | gzip -9c > "$CLIENTINITRD"
else
echo "$PROG: Aviso: no se ha modificado la clave del cliente \"$OGLIVE\"."
fi