From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 17 17:00:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21F1416A4CE for ; Fri, 17 Dec 2004 17:00:16 +0000 (GMT) Received: from manor.msen.com (manor.msen.com [148.59.4.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id C672943D2F for ; Fri, 17 Dec 2004 17:00:15 +0000 (GMT) (envelope-from wayne@manor.msen.com) Received: from manor.msen.com (localhost [127.0.0.1]) by manor.msen.com (8.12.9p2/8.12.9) with ESMTP id iBHH0CO7096064 for ; Fri, 17 Dec 2004 12:00:14 -0500 (EST) (envelope-from wayne@manor.msen.com) Received: (from wayne@localhost) by manor.msen.com (8.12.9p2/8.12.9/Submit) id iBHH0CU8096063 for freebsd-hackers@freebsd.org; Fri, 17 Dec 2004 12:00:12 -0500 (EST) (envelope-from wayne) Date: Fri, 17 Dec 2004 12:00:12 -0500 From: "Michael R. Wayne" To: freebsd-hackers@freebsd.org Message-ID: <20041217170012.GI803@manor.msen.com> Mail-Followup-To: freebsd-hackers@freebsd.org References: <1103310712.53001.22.camel@red.nativenerds.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1103310712.53001.22.camel@red.nativenerds.com> User-Agent: Mutt/1.4.2.1i Subject: Re: query cdrw tray X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2004 17:00:16 -0000 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