Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2003 11:16:25 +0200
From:      David Rio <drio@perpels.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: how to know if there is a cd inside the cdwriter
Message-ID:  <20030518091625.GA11341@perpels.com>
In-Reply-To: <20030518060417.GA670@sten.alder.net>
References:  <20030516070445.GA43651@perpels.com> <44bry1ngdc.fsf@be-well.ilk.org> <20030518060417.GA670@sten.alder.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 18, 2003 at 02:04:17AM -0400, Bob Hall wrote:
> 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

Thanks.
I have received another answer from Lowell Gilbert that point me to use 
"cdcontrol info" and then parse the output. This one is good too.



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