Jump to content

I am trying to make an automatic burner for newbs


SwiftDeath
 Share

Recommended Posts

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 Started

echo 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]

Link to comment
Share on other sites

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 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

 

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 by SwiftDeath
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...