Archivos md5
GatoLoko .
gatoloko en gmail.com
Mar Jul 3 23:09:20 BST 2007
El día 28/06/07, Victor Martinez <pacharico en yahoo.es> escribió:
>
> Un saludo al grupo:
>
> Quería preguntar si hay algún programa "gráfico" para comprobar los
> archivos que se descargan de Internet por medio de los *.md5.
>
> Se que en la linea de comandos se puede, y el k3b te lee antes de grabar
> la suma md5, pero lo que busco es un programita que pinche en el *md5 y
> me diga si la ISO está correcta.
>
> Un saludo y gracias por vuestro tiempo.
>
Si usas nautilus (el gestor de archivos de gnome), puedes añadir scripts al
directorio ".gnome2/nautilus-scripts" para que aparezcan en el menú del
botón derecho.
El siguiente script te servirá para esto:
---------- PRINCIPIO DEL CÓDIGO -----------
#!/bin/bash
# AUTHOR: (c) Tony Mattsson <tony_mattsson en home.se>
# VERSION: 1.0
# LICENSE: GPL (http://www.gnu.org/licenses/gpl.html)
# REQUIRES: gxmessage, md5sum, mawk, zenity
# NAME: Check md5
# DESCRIPTION: Checks the md5 hash checksum of files listed in a .md5-file
# Language settings
Passed="OK"
Failed="FAILED"
PrintAllOk="All files are OK!"
PrintFail1="file(s) are OK and"
PrintFail2="file(s) are corrupt!"
case $LANG in
sv* )
Passed="OK"
Failed="MISSLYCKADES"
PrintAllOk="Alla filer är OK!"
PrintFail1="fil(er) är OK och"
PrintFail2="fil(er) är korrupta!"
es* )
Passed="Correcto"
Failed="FALLIDO"
PrintAllOk="Todos los archivos son correctos"
PrintFail1="archivo(s) son correctos y"
PrintFail2="archivo(s) están corruptos!"
esac
for File in "$@"
do
if [[ ${File:(( ${#File} -4 )):4} != ".md5" ]];then
zenity --error --title="Check md5"--text="This is not a '.md5' checksum
file."
exit
fi
# 1 Check the md5 file
(md5sum -c "$File" > /tmp/checktext.txt) 2>&1 | zenity --progress --title
"Check md5" --text "Checking: $File" --pulsate --auto-close
# 2 Display the results!
# Print a little repport about how many failed and how many passed
NumberOK=`cat /tmp/checktext.txt | fgrep -o -e "$Passed" | wc -l`
NumberFailed=`cat /tmp/checktext.txt | fgrep -o -e "$Failed" | wc -l`
if [ $NumberFailed == 0 ]; then
StatusMessage="$PrintAllOk"
else
StatusMessage="$NumberOK $PrintFail1 $NumberFailed $PrintFail2"
fi
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" >> /tmp/checktext.txt
echo "$StatusMessage" >> /tmp/checktext.txt
zenity --text-info --title "$File" --width=640 --height=480
--filename=/tmp/checktext.txt
done
---------- FIN DEL CÓDIGO -----------
Espero que os sea de utilidad.
--
Raúl Soriano (GatoLoko), SpainTeam Local Community Contact.
http://www.ubuntu-spain.org - http://wiki.ubuntu.com/GatoLoko
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: https://lists.ubuntu.com/archives/ubuntu-es/attachments/20070704/cc936456/attachment.htm
Más información sobre la lista de distribución ubuntu-es