Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Dec 2004 12:00:12 -0500
From:      "Michael R. Wayne" <wayne@staff.msen.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: query cdrw tray
Message-ID:  <20041217170012.GI803@manor.msen.com>
In-Reply-To: <1103310712.53001.22.camel@red.nativenerds.com>
References:  <1103310712.53001.22.camel@red.nativenerds.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 17, 2004 at 12:11:52PM -0700, Ed Stover wrote:
> 
> How to I ask the CD burner if it's tray is open or closed? I am creating
> a automagical shell script to do semi-unattended backups and need to
> figure out how to make sure there is a cd in the tray before I start
> burning. Any help would be greatly appreciated.

Having solved this once before, here's the code I used:

   #!/bin/sh 

   # Spin wait for a CD into the drive
   while /usr/X11R6/bin/cda status | /usr/bin/grep -q '^No_Disc' 
   do
	   sleep 1;
   done



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