SwiftDeath Posted July 16, 2004 Report Share Posted July 16, 2004 Hello, I've decided its about time to give something back, and I'm trying to write a shell script that'll automatically check all 3 Mandrake Isos md5checksums and if their good then burn them. Since this is my first script I'm running into trouble. Here is what I got so far. echo Burn Script Startedecho Created by SwiftDeath /----- No clue how to do this part---- echo Please wait... Checking Intergrity of Mandrake ISO Images md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso if test "$X" -gt "$Y"; then echo "$X is greater than $Y" elif test "$X" -lt "$Y"; then echo "$X is less than $Y" else echo "$X is equal to $Y" /----- Really confusing part over ---- cdrecord -scanbus echo Please enter the 3 numbers corresponding to your burner; Example: 0,1,0 or 0,0,0 read BURNER echo Please insert a Blank Disc into your burner ($BURNER) eject $BURNER cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD1.i586.iso eject $BURNER cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD2.i586.iso eject $BURNER cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD3.i586.iso The second paragraph is where It'll check the md5sums. I'd also like to try and get it too check the md5 checks sums of the cd right after it burns them. Please feel free to leave any critism that you like. If you see a better way of doing something or lots of flaws, please tell me, Thanks, SwiftDeath [moved from Terminal Shell Commands, etc by spinynorman] Quote Link to comment Share on other sites More sharing options...
Darkelve Posted July 16, 2004 Report Share Posted July 16, 2004 Nice idea. Sadly, I don't know anything about this stuff, however. Quote Link to comment Share on other sites More sharing options...
SwiftDeath Posted July 16, 2004 Author Report Share Posted July 16, 2004 (edited) Hmm I made some more changes. And It works a little bit better and goes a bit father. This is what I got so far. echo Burn Script Startedecho Created by SwiftDeath cdrecord -scanbus echo Please enter the 3 numbers corresponding to your burner. Example 0,1,0 or 0,0,0 read BURNER echo Please enter the mount point of your buner. Usually /mnt/cdrom or /mnt/cdrom2 read MOUNT echo Please tell the directory of your Mandrake Isos read DIR cd $DIR echo Moving to $DIR echo Please wait... Checking Intergrity of Mandrake ISO Images. Please check a site to see if these checksums match the sites, to insure a good quality burn. md5sum Mandrake*.iso eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key mount $MOUNT cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD1.i586.iso eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key mount $MOUNT cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD2.i586.iso eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key mount $MOUNT cdrecord -v -eject speed=8 dev=$burner Mandrakelinux10.0-Official-Download-CD3.i586.iso echo Congratulations! It appears you have downloaded and burned all 3 Mandrake CDS. Hmmm the only problems are the cd-rom doesn't close. And I also don't know how to make sure it burned right. I won't be able to test eitheir until I rip the isos off my Mandrake Cds. Thanks for help, SwiftDeath Edited July 17, 2004 by SwiftDeath Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted July 19, 2004 Report Share Posted July 19, 2004 To make the cdrom close, use the -t option to eject: eject -t /dev/cdrom Quote Link to comment Share on other sites More sharing options...
Qchem Posted July 19, 2004 Report Share Posted July 19, 2004 You might want to start it with #!/bin/bash and finish with exit 0 too. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted July 19, 2004 Report Share Posted July 19, 2004 And I also don't know how to make sure it burned right. There's a nice script to verify the burn is good called rawrite: http://www.troubleshooters.com/linux/coasterless.htm It's extremely accurate. Quote Link to comment Share on other sites More sharing options...
SwiftDeath Posted July 19, 2004 Author Report Share Posted July 19, 2004 Thanks guys, this seems like helpful information. I'll spend a couple hours working on it. And I'll also make some different versions for different uses. Like maybe a fedora and an industrial version (for mass-burning a certain distro). Hmmm, maybe I could even get it to read info from a different file. So I could make a config file. Thanks for the help guys, SwiftDeath Quote Link to comment Share on other sites More sharing options...
SwiftDeath Posted July 19, 2004 Author Report Share Posted July 19, 2004 Ok, I made some changes and the cdrom closes. Unfortunatly it doesn't recognize the rawread command even though I put the script the in the directory and it made it exectuable. I gotta download the Mandrake Isos again to test if my script burns them right. Here are my modifications. Thanks for the help everyone. #!/bin/bash echo Burn Script Started echo Created by SwiftDeath cdrecord -scanbus echo Please enter the 3 numbers corresponding to your burner. Example 0,1,0 or 0,0,0 read BURNER echo Please enter the mount point of your buner. Usually /mnt/cdrom or /mnt/cdrom2 read MOUNT echo Please tell the directory of your Mandrake Isos read DIR cd $DIR echo Moving to $DIR echo Please wait... Checking Intergrity of Mandrake ISO Images. Please check a site to see if these checksums match the sites, to insure a good quality burn. md5sum Mandrake*.iso cdrecord dev=$BURNER speed=10 blank=fast -v -eject eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD1.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD2.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -tt $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD3.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. echo Congratulations! It appears you have downloaded and burned all 3 Mandrake CDS. exit 0 Thanks Everyone, SwiftDeath Quote Link to comment Share on other sites More sharing options...
Darkelve Posted July 19, 2004 Report Share Posted July 19, 2004 Good luck! Quote Link to comment Share on other sites More sharing options...
grendal Posted July 19, 2004 Report Share Posted July 19, 2004 Yeah, Good Luck!! I hope your hard work pays off. I know I would never be able to figure it out. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted July 20, 2004 Report Share Posted July 20, 2004 I'm gonna post here what i mentioned in IRC: When your script checks the md5sum, there is a file called something like blahblahmd5sum.asc that the user should download and put in the same directory as their isos. It would be much safer/easier for you to just instruct the user to do so rather than you trying to write it into the script. Then the command would be md5sum -c *.asc and it will verify all the ISOs giving you an OK or a FAILED. Quote Link to comment Share on other sites More sharing options...
thinkliberty Posted July 28, 2004 Report Share Posted July 28, 2004 You should ask the user what speed their CD burner is, also have an option if unsure to press enter and go with a default of 4. just my 2 cents Ok, I made some changes and the cdrom closes. Unfortunatly it doesn't recognize the rawread command even though I put the script the in the directory and it made it exectuable. I gotta download the Mandrake Isos again to test if my script burns them right. Here are my modifications. Thanks for the help everyone. #!/bin/bash echo Burn Script Started echo Created by SwiftDeath cdrecord -scanbus echo Please enter the 3 numbers corresponding to your burner. Example 0,1,0 or 0,0,0 read BURNER echo Please enter the mount point of your buner. Usually /mnt/cdrom or /mnt/cdrom2 read MOUNT echo Please tell the directory of your Mandrake Isos read DIR cd $DIR echo Moving to $DIR echo Please wait... Checking Intergrity of Mandrake ISO Images. Please check a site to see if these checksums match the sites, to insure a good quality burn. md5sum Mandrake*.iso cdrecord dev=$BURNER speed=10 blank=fast -v -eject eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD1.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD2.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -tt $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD3.i586.iso md5sum Mandrakelinux10.0-Official-Download-CD1.i586.iso rawread $MOUNT | md5sum echo If those 2 keys match your burn of this cd was sucessfull. echo Congratulations! It appears you have downloaded and burned all 3 Mandrake CDS. exit 0 Thanks Everyone, SwiftDeath <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
SwiftDeath Posted July 30, 2004 Author Report Share Posted July 30, 2004 Sounds good, I am gonna test it out later today. I am downloading the MDK cds right now to test it all. Quote Link to comment Share on other sites More sharing options...
SwiftDeath Posted July 30, 2004 Author Report Share Posted July 30, 2004 I updated and I didn't have it check the burn. It seems to be working pretty good. Using your suggestions (Ohms) it checks the md5sum automatically. #!/bin/bash echo Burn Script Started echo Created by SwiftDeath echo Please make sure you burner supports a speed of 10x or edit this script to your speed. cdrecord -scanbus echo Please enter the 3 numbers corresponding to your burner. Example 0,1,0 or 0,0,0 read BURNER echo Please enter the mount point of your buner. Usually /mnt/cdrom or /mnt/cdrom2 read MOUNT echo Please tell the directory of your Mandrake Isos read DIR cd $DIR echo Moving to $DIR echo Please wait... Checking Intergrity of Mandrake ISO Images. Please check a site to see if these checksums match the sites, to insure a good quality burn. wget ftp://ftp.cise.ufl.edu/pub/mirrors/mandra...ownload.md5.asc md5sum -c Mandrakelinux10.0-Official-Download.md5.asc cdrecord dev=$BURNER speed=10 blank=fast -v -eject eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD1.i586.iso eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -t $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD2.i586.iso eject $MOUNT echo Please insert a Blank Disc into your $MOUNT. Press any key to continue read key eject -tt $MOUNT cdrecord dev=$BURNER speed=10 -pad -v -eject Mandrakelinux10.0-Official-Download-CD3.i586.iso echo Congratulations! It appears you have downloaded and burned all 3 Mandrake CDS. exit 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.