Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2003 02:04:17 -0400
From:      "Bob Hall" <rjhalljr@starpower.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: how to know if there is a cd inside the cdwriter
Message-ID:  <20030518060417.GA670@sten.alder.net>
In-Reply-To: <44bry1ngdc.fsf@be-well.ilk.org>
References:  <20030516070445.GA43651@perpels.com> <44bry1ngdc.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
David Rio <drio@perpels.com> writes:
 
> I am writing a little script to backup my data. I would like 
> to know if there is a CD inside the cdwriter before launch the
> burn process. Any idea?

Here's a snippet from a bash script I use to do the same thing with 
a dvd burner. The burner is external, so the script has alread checked 
to see if the burner is mounted.

        melding=$(sudo mount -t ufs -o rw /dev/cd0a $montering_punkt 2>&1)
        #Om mount ikke returnerer 0, er noe galt.
        if [ $? -ne 0 ]
        then
                if [ "$melding" = "mount: /dev/cd0a: Device not configured" ]
                then

HTH, 
Bob Hall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030518060417.GA670>