View previous topic :: View next topic |
Author |
Message |
mC n00b
Joined: 19 Sep 2003 Posts: 17
|
Posted: Tue Sep 23, 2003 2:00 am Post subject: menu based cdrtools front-end (bash) |
|
|
Hello everyone. Just thought I'd post this up here... might be useful for someone. I wrote this script based on cdtools 2.01_alpha14 so ATAPI is supported. Feel free to suggest features, bugfix, etc.
Install:
Code: | $ tar zxvf burner.tar.gz
$ nano burner
*** EDIT THE 3 VARIABLES FOUND UNDER SETTINGS ***
$ cp burner /usr/local/bin/
$ chmod 755 /usr/local/bin/burner |
Source:
Code: | # !/bin/sh
#
# burner - menu based cdrtools front-end
# Copyright (C) 2003 Mark Carriedo (mark@f2o.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
# settings
CDROM="/dev/hdb"
CDRW="ATAPI:/dev/hdc"
CDRWOPTS="burnfree"
echo Please select an option:
OPTIONS="Burn Copy ISO Erase Quit"
select OPT in $OPTIONS; do
if [ "$OPT" = "Burn" ]; then
echo What would you like to burn?
OPTIONS="Folder ISO Quit"
select OPT in $OPTIONS; do
if [ "$OPT" = "Folder" ]; then
while [ "$FOLDER" = "" ]; do
echo "Where is the folder? (/path/foobar/)"
read -e -p "#? " FOLDER
done
mkisofs -J -r -o /tmp/cd.iso ${FOLDER}
while [ "$SPEED" = "" ]; do
echo What speed would you like to burn at?
read -p "#? " SPEED
done
cdrecord -v dev=${CDRW} speed=${SPEED} driveropts=${CDRWOPTS} -dao /tmp/cd.iso
exit
elif [ "$OPT" = "ISO" ]; then
while [ "$FILE" = "" ]; do
echo "Where is the ISO? (/path/foobar.iso)"
read -e -p "#? " FILE
done
while [ "$SPEED" = "" ]; do
echo What speed would you like to burn at?
read -p "#? " SPEED
done
cdrecord -v dev=${CDRW} speed=${SPEED} driveropts=${CDRWOPTS} -dao ${FILE}
exit
elif [ "$OPT" = "Quit" ]; then exit
else echo Invalid option!
fi
done
elif [ "$OPT" = "Copy" ]; then
while [ "$SPEED" = "" ]; do
echo What speed would you like to burn at?
read -p "#? " SPEED
done
cdrecord -v dev=${CDRW} speed=${SPEED} driveropts=${CDRWOPTS} -isosize ${CDROM}
exit
elif [ "$OPT" = "ISO" ]; then
echo What would you like to create into an ISO?
OPTIONS="CD Folder Quit"
select OPT in $OPTIONS; do
if [ "$OPT" = "CD" ]; then
while [ "$FILE" = "" ]; do
echo "Where would you like to save the ISO? (/path/foobar.iso)"
read -e -p "#? " FILE
done
dd if=${CDROM} of=${FILE}
exit
elif [ "$OPT" = "Folder" ]; then
while [ "$FOLDER" = "" ]; do
echo "Where is the folder? (/path/foobar/)"
read -e -p "#? " FOLDER
done
while [ "$FILE" = "" ]; do
echo "Where would you like to save the ISO? (/path/foobar.iso)"
read -e -p "#? " FILE
done
mkisofs -J -r -o ${FILE} ${FOLDER}
exit
elif [ "$OPT" = "Quit" ]; then exit
else echo Invalid option!
fi
done
elif [ "$OPT" = "Erase" ]; then
echo How would you like to erase the CD-RW?
OPTIONS="Quick Full Quit"
select OPT in $OPTIONS; do
if [ "$OPT" = "Quick" ]; then
cdrecord -v dev=${CDRW} blank=fast
exit
elif [ "$OPT" = "Full" ]; then
cdrecord -v dev=${CDRW} blank=all
exit
elif [ "$OPT" = "Quit" ]; then exit
else echo Invalid option!
fi
done
elif [ "$OPT" = "Quit" ]; then exit
else echo Invalid option!
fi
done
#####
#
# Revision History
#
# $Id: burner,v 1.1 2003/09/17 13:55:14 mark Exp $
#
# $Log: burner,v $
# Revision 1.1 2003/09/17 13:55:14 mark
# Initial revision
#
###### |
Last edited by mC on Sun Sep 28, 2003 9:03 am; edited 2 times in total |
|
Back to top |
|
|
ragnoroc n00b
Joined: 08 May 2003 Posts: 49 Location: Columbus, OH
|
Posted: Tue Sep 23, 2003 8:02 am Post subject: |
|
|
I'll give it a shot.
This is definitly a good idea. It just takes one less step out of burning cds and dvds.
Thanks for the work. |
|
Back to top |
|
|
jaska Bodhisattva
Joined: 06 Jun 2003 Posts: 725 Location: Finland
|
Posted: Sat Oct 04, 2003 8:56 am Post subject: |
|
|
The atapi cd burning is working quite well for me, no problems yet. |
|
Back to top |
|
|
mC n00b
Joined: 19 Sep 2003 Posts: 17
|
Posted: Sun Oct 05, 2003 7:41 am Post subject: |
|
|
Glad you guys find it useful. Any other features I should add to it? |
|
Back to top |
|
|
Headhunter123 Guru
Joined: 19 Oct 2002 Posts: 509
|
Posted: Sun Oct 05, 2003 9:28 am Post subject: |
|
|
You know app-cdr/burncenter, don't you? |
|
Back to top |
|
|
mC n00b
Joined: 19 Sep 2003 Posts: 17
|
Posted: Sun Oct 05, 2003 1:11 pm Post subject: |
|
|
Yes I do, I've tried CDRX as well... all text-based. However I didn't like the menu hierarchy and hence I decided to write a simpler smaller script. |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Mon Dec 01, 2003 9:09 pm Post subject: |
|
|
i love this script. thanks for sharing it |
|
Back to top |
|
|
mC n00b
Joined: 19 Sep 2003 Posts: 17
|
Posted: Tue Dec 02, 2003 1:37 am Post subject: |
|
|
Yea, it's very simple but I find it quite helpful. I'm a big minimalist I'm still planning on adding mp3 to cda, and others. I'll post it up when I'm done. |
|
Back to top |
|
|
Jazz Guru
Joined: 16 Nov 2003 Posts: 543 Location: Melbourne, Australia
|
Posted: Tue Dec 02, 2003 1:52 am Post subject: |
|
|
AHHH !! great !
One thing though ! wud it be possible to run this script in another distro ???
Like sometimes i have to boot in DamnSmallLinux so.. will it be useful there ?
Also, try to make it more interactive ! like prompt the user for the location of his devives such as cdrom and cdrw.... cuz if its gonna be on a live cd ! then its gonna be very difficult to run it everywhere !!
Anyways, its really great ! i always wanted to do that on DOS !! hehehe.. but finally i reliased that dos was not worth my time !
Bye,
Jassi |
|
Back to top |
|
|
chipi n00b
Joined: 05 Oct 2003 Posts: 62 Location: Israel
|
Posted: Tue Dec 02, 2003 10:18 am Post subject: |
|
|
thanks for this script
if it will support burning audio cds from mp3s (and oggs?) it will be even better
thanks again |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Tue Dec 02, 2003 10:37 am Post subject: |
|
|
you can use 'mp3burn' (in portage) to burn mp3s.
i am not sure it can burn ogg-vorbis files. set your
cdrecord options in ~/.mp3burnrc and use 'mp3burn
/foo/*.mp3' to burn all mp3s in a dir as cdaudio.
i think something like this put in the script above would
properly call mp3burn, though make sure ~/.mp3burnrc
is set up properly:
Code: | OPTIONS="Folder ISO Audio Quit" |
and then, after the 'exit' of the ISO burn section:
Code: | elif [ "$OPT" = "Audio" ]; then
while [ "$MP3S" = "" ]; do
echo "Where are your mp3s (one CD's worth; /path/*.mp3)"
read -e -p "#? " MP3S
done
mp3burn ${MP3S}
exit
|
*note* i have not tested this. |
|
Back to top |
|
|
jdoe Tux's lil' helper
Joined: 02 Jun 2003 Posts: 122 Location: Italy - Florence - Empoli
|
Posted: Tue Dec 02, 2003 6:54 pm Post subject: |
|
|
hi... just tried it but i need to modify it a little.
first off all, if I want to pass the -overburn opt to cdrecord i hve to modify the script every time cdrecord it's called, so i just made another variable...
second, i've problems with name containing space...
i.e.
Code: |
while [ "$FOLDER" = "" ]; do
echo "Where is the folder? (/path/foobar/)"
read -e -p "#? " FOLDER
done
mkisofs -J -r -o /tmp/cd.iso ${FOLDER}
|
if the path is /tmp/foobar/my\ folder/ the result is "my no such file or dir"
solution... put ${FOLDER} into "" ---> "${FOLDER}"
shall i post the script with my mods?
John _________________ me |
|
Back to top |
|
|
tobold n00b
Joined: 12 Aug 2003 Posts: 62
|
Posted: Tue Dec 02, 2003 8:53 pm Post subject: |
|
|
neenee wrote: | you can use 'mp3burn' (in portage) to burn mp3s.
i am not sure it can burn ogg-vorbis files. set your
cdrecord options in ~/.mp3burnrc and use 'mp3burn
/foo/*.mp3' to burn all mp3s in a dir as cdaudio.
i think something like this put in the script above would
properly call mp3burn, though make sure ~/.mp3burnrc
is set up properly:
|
Using mp3burn works fine in the script. I only added a few lines so that you don't have to set your .mp3burnrc by hand and that have the choice of speed.
Pay attention!! If you are using this script you override existing .mp3burnrc files !!!
after the 'exit' of the ISO burn section:
## MP3 Burn Section using using mp3brun
elif [ "$OPT" = "Audio" ]; then
while [ "$MP3S" = '' ]; do
echo "Where are your mp3s (one CD's worth; /path/*.mp3)"
read -e -p "#? " MP3S
while [ "$SPEED" = "" ]; do
echo What speed would you like to burn at?
read -p "#? " SPEED
done
done
echo '$cdrecord_opts ="-v dev='${CDRW}' speed='${SPEED}'";' > ~/.mp3burnrc
echo '$tmpdir ="/tmp" ;' >> ~/.mp3burnrc
mp3burn ${MP3S}
exit
## MP3-Burn Section End |
|
Back to top |
|
|
|