Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
menu based cdrtools front-end (bash)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
mC
n00b
n00b


Joined: 19 Sep 2003
Posts: 17

PostPosted: Tue Sep 23, 2003 2:00 am    Post subject: menu based cdrtools front-end (bash) Reply with quote

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
View user's profile Send private message
ragnoroc
n00b
n00b


Joined: 08 May 2003
Posts: 49
Location: Columbus, OH

PostPosted: Tue Sep 23, 2003 8:02 am    Post subject: Reply with quote

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
View user's profile Send private message
jaska
Bodhisattva
Bodhisattva


Joined: 06 Jun 2003
Posts: 725
Location: Finland

PostPosted: Sat Oct 04, 2003 8:56 am    Post subject: Reply with quote

The atapi cd burning is working quite well for me, no problems yet.
Back to top
View user's profile Send private message
mC
n00b
n00b


Joined: 19 Sep 2003
Posts: 17

PostPosted: Sun Oct 05, 2003 7:41 am    Post subject: Reply with quote

Glad you guys find it useful. Any other features I should add to it?
Back to top
View user's profile Send private message
Headhunter123
Guru
Guru


Joined: 19 Oct 2002
Posts: 509

PostPosted: Sun Oct 05, 2003 9:28 am    Post subject: Reply with quote

You know app-cdr/burncenter, don't you?
Back to top
View user's profile Send private message
mC
n00b
n00b


Joined: 19 Sep 2003
Posts: 17

PostPosted: Sun Oct 05, 2003 1:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Mon Dec 01, 2003 9:09 pm    Post subject: Reply with quote

i love this script. thanks for sharing it :wink:
Back to top
View user's profile Send private message
mC
n00b
n00b


Joined: 19 Sep 2003
Posts: 17

PostPosted: Tue Dec 02, 2003 1:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Jazz
Guru
Guru


Joined: 16 Nov 2003
Posts: 543
Location: Melbourne, Australia

PostPosted: Tue Dec 02, 2003 1:52 am    Post subject: Reply with quote

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
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Tue Dec 02, 2003 10:18 am    Post subject: Reply with quote

thanks for this script :)

if it will support burning audio cds from mp3s (and oggs?) it will be even better :D

thanks again :wink:
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Tue Dec 02, 2003 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
jdoe
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jun 2003
Posts: 122
Location: Italy - Florence - Empoli

PostPosted: Tue Dec 02, 2003 6:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
tobold
n00b
n00b


Joined: 12 Aug 2003
Posts: 62

PostPosted: Tue Dec 02, 2003 8:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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