Support Wrong Planet Awareness!
| View previous topic :: View next topic |
| Author |
Message |
Fuzzy Ack! Thbbbt!


Joined: Mar 31, 2006 Posts: 3693 Location: Alberta Canada
|
Posted: Sun Apr 19, 2009 9:23 am Post subject: Linux bash script |
|
|
Here is a little bash/zenity script that I wrote. You'll need to have zenity installed too. I think it comes preinstalled.
Bash is somewhat like the batch files in windows(such as autoexec.bat), but much more developed.
What my script does is allows you to select a file, which is then run through a formula called an md5 checksum. checksums are used to assess the integrity of file, especially large ones that are to be written to cd/dvd. They are most commonly seen in conjunction with operating install disk images(iso format).
My script takes this checksum and places it in an information box, so that you can compare it to the checksum provided by the download site. If they match up, you know that your file is good and you can go ahead and burn it to optical disk.
Copy this into a file called checksum.sh
| Code: |
#! /bin/bash
/usr/bin/zenity --info --text=" Your md5 checksum result is \n\n "$( md5sum $(/usr/bin/zenity --file-selection --title="Checksum a File" ))
|
I save it in a script folder in my documents. From there - at least in ubuntu - right click it and select properties, then the permissions tab. checkmark "allow executing file as program" and close.
Now you can double click it and select run, but there is a way to make things nicer.
Create a launcher.
on the desktop - again in ubuntu/debian, and maybe others - select create launcher and browse to find checksum.sh. fill in a name for the launcher - I called mine "check md5 sum" - and maybe a comment about what it does(this is for mouse overs). You can also click the little spring graphic to set an icon. close it and double click the launcher.
Now you wont get all the run in terminal/display/cancel/run buttons. You can move the launcher into the menu as well. I put mine in accessories.
Next project I will make it do the comparison for you and make it so that you can right click a file and select check md5 sum. _________________ davidred wrote...
I installed Ubuntu once and it completely destroyed my paying relationship with Microsoft.
"careful observation of reality is a holy book unto itself" - techstepgenr8tion |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|