?>/script>'; } ?> Ayuda para script testeo compilacion updaters Widgets Magazine

Autor Tema: Ayuda para script testeo compilacion updaters  (Leído 5002 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Ayuda para script testeo compilacion updaters
« en: 31-10-2015, 22:56 (Sábado) »
bueno , la idea principal es un bash script , que diciendole la categoria ...


entre , y vaya lanzando uno detras de otro en una shell ... listarlos y tal es facil ,pero tengo dudas de como hacer para que solo lance el siguiente cuando el primero a acabado del todo.

si se produce un error en un updater...que registre el updater fallido ...para mostrarme despues si ha fallado alguno y revisarlo.


quiero algo asi ,por que podria lanzar un script y pirarme a dormir ...por que testear que todo compila me lleva varias horas tontas , solo para lanzar los scripts.



habia pensado en divirilo todo en funciones ...para poder lanzar los de "x" categoria ...y una funcion "glogal"  , con la que poder lanzar todas las demas funciones individuales.

quiero poder blacklistear paquetes como qt5 , que no me interesaria en ese test masivo ...o los de kernel.
« Última modificación: 31-10-2015, 22:57 (Sábado) por USUARIONUEVO »

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #1 en: 31-10-2015, 23:17 (Sábado) »
esto , ejecutara todos los updaters de la categoria Internet ..uno tras otro , pero no se como leer si salio bien o mal ...

Código: [Seleccionar]
#!/bin/bash

Internet(){
CATEGORIA=Internet
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR_INTERNET=`ls *_updater`
for I in $LISTAR_INTERNET; do
xterm -e sh -c "yes y | $RUTA/$I"
done
}

Internet

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #2 en: 31-10-2015, 23:53 (Sábado) »
este es mi script inicial .... solo me falta , detectar si falla o no algun updater ...para poder listarlos al acabar todo..y mirar los que han fallado.


la idea de dividir todo en funciones, es poder lanzar una categoria .. o todas



Código: [Seleccionar]
#!/bin/bash

Auditoria(){
CATEGORIA=Auditoria
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Desarrollo(){
CATEGORIA=Desarrollo
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v qt5_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Drivers(){
CATEGORIA=Drivers
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=acsccid_updater
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Internet(){
CATEGORIA=Internet
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Juegos(){
CATEGORIA=Juegos
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Librerias(){
CATEGORIA=Librerias
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Multimedia(){
CATEGORIA=Multimedia
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Navegadores(){
CATEGORIA=Navegadores
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v firefox_multi`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Oficina(){
CATEGORIA=Oficina
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Pentest(){
CATEGORIA=Pentest
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Sistema(){
CATEGORIA=Sistema
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v linux`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
done
}

Todas(){
Auditoria
Desarrollo
Drivers
Internet
Juegos
Librerias
Multimedia
Navegadores
Oficina
Pentest
Sistema
}

"$@"

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #3 en: 01-11-2015, 00:01 (Domingo) »
Auditoria(){
CATEGORIA=Auditoria
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
if [ "$?" = "0" ]; then
echo "Error en $X"
fi

done
}




edit : NO ME SIRVE ...SIEMPRE DICE QUE ACABO EN ERROR.
« Última modificación: 01-11-2015, 00:10 (Domingo) por USUARIONUEVO »

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #4 en: 01-11-2015, 00:52 (Domingo) »
estaba mirando como hacia el updatergui ...y claro ... recorta el funciones finales ....donde esta el exit.



de momento como es una chapuza para mi solo ...lo que hare es comprobar si se ha generado el fichero ...solo se puede haber generado si salio bien  ;D


Auditoria(){
CATEGORIA=Auditoria
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
if [ ! -f /root/Desktop/$CATEGORIA/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi

done
}
« Última modificación: 01-11-2015, 01:29 (Domingo) por USUARIONUEVO »

trax69

  • Visitante
Re: Ayuda para script testeo compilacion updaters
« Respuesta #5 en: 01-11-2015, 01:44 (Domingo) »
Puedes darle salida a un log a todos y luego buscar en todos los logs

Internet >script A>Internet /logA
Internet >script B>Internet /logB
Librerías >script C>librerías /logC

Función para comprobar errores

Lee todos los logs dentro de una categoría o todos a la vez y listar aquellos que no contengan la palabra "error" mostrará los que salieron bien o buscar por otra cosa.

De todos modos... Me suena que hay algún método mucho más sencillo ahora le doy algúna vuelta


Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #6 en: 01-11-2015, 01:49 (Domingo) »
de momento , me apaño , con mirar si se genero el fichero ...señal inequivoca de que salio bien


ademas , despues lo borro todo antes de lanzar el siguiente updater , asi ahorro espacio.

ademas si un updater tiene una dependencia la autoresuelve , y despues al querer mirar si se genero el fichero , podria haber 2 ficheros... el que se resolvio de la dependencia y el que se genero cuando le toco el turno al updater de esa dependencia.


asi que , miro si hay fichero ... y elimino despues.


a fin de cuentas solo quiero ver los errores.   ;)

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #7 en: 01-11-2015, 01:49 (Domingo) »
Código: [Seleccionar]
Sistema(){
CATEGORIA=Sistema
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v linux`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Desconectado USUARIONUEVO

  • Moderador
  • *
  • Mensajes: 15985
Re: Ayuda para script testeo compilacion updaters
« Respuesta #8 en: 01-11-2015, 01:51 (Domingo) »
script entero .... en segun que categorias se ve que evito pillar tal o cual updater como en sistema que no quiero lanzar lode kerneles.



Código: [Seleccionar]
#!/bin/bash

Auditoria(){
CATEGORIA=Auditoria
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Desarrollo(){
CATEGORIA=Desarrollo
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v qt5_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Drivers(){
CATEGORIA=Drivers
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=acsccid_updater
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Internet(){
CATEGORIA=Internet
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Juegos(){
CATEGORIA=Juegos
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Librerias(){
CATEGORIA=Librerias
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Multimedia(){
CATEGORIA=Multimedia
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Navegadores(){
CATEGORIA=Navegadores
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v firefox_multi`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Oficina(){
CATEGORIA=Oficina
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Pentest(){
CATEGORIA=Pentest
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Sistema(){
CATEGORIA=Sistema
RUTA=/opt/wifislax-updaters/$CATEGORIA
cd $RUTA
LISTAR=`ls *_updater|grep -v linux`
for X in $LISTAR; do
xterm -e sh -c "yes y | $RUTA/$X"
PAQUETE=`echo $X|sed 's/_updater//g'`
DESTINO=/root/Desktop/$CATEGORIA
if [ ! -f $DESTINO/$PAQUETE-[0-9]* ]; then
echo "Error en $X"
fi
if [ -d $DESTINO ]; then
rm -rf $DESTINO
fi
done
}

Todas(){
Auditoria
Desarrollo
Drivers
Internet
Juegos
Librerias
Multimedia
Navegadores
Oficina
Pentest
Sistema
}

"$@"

trax69

  • Visitante
Re: Ayuda para script testeo compilacion updaters
« Respuesta #9 en: 01-11-2015, 02:21 (Domingo) »
en principio te podria valer lo he mirado asi por encima está bien

vk496

  • Visitante
Re: Ayuda para script testeo compilacion updaters
« Respuesta #10 en: 01-11-2015, 19:38 (Domingo) »
Puedes aprovechar los return de cada compilación.

Cuand acabe un script, accedes a su exit code con:

Código: [Seleccionar]
echo $?
Si ha salido bien, debería ser un 0

Salu2