From owner-freebsd-questions@FreeBSD.ORG Sat May 17 23:06:45 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BA1C37B401 for ; Sat, 17 May 2003 23:06:45 -0700 (PDT) Received: from smtp03.mrf.mail.rcn.net (smtp03.mrf.mail.rcn.net [207.172.4.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 110C943F93 for ; Sat, 17 May 2003 23:06:45 -0700 (PDT) (envelope-from rjhalljr@starpower.net) Received: from 66-44-55-150.s404.tnt1.lnhva.md.dialup.rcn.com ([66.44.55.150] helo=sten.alder.net) by smtp03.mrf.mail.rcn.net with smtp (Exim 3.35 #4) id 19HHJk-0000dM-00 for freebsd-questions@freebsd.org; Sun, 18 May 2003 02:06:45 -0400 Received: by sten.alder.net (sSMTP sendmail emulation); Sun, 18 May 2003 02:04:17 -0400 Date: Sun, 18 May 2003 02:04:17 -0400 From: "Bob Hall" To: freebsd-questions@freebsd.org Message-ID: <20030518060417.GA670@sten.alder.net> Mail-Followup-To: Bob Hall , freebsd-questions@freebsd.org References: <20030516070445.GA43651@perpels.com> <44bry1ngdc.fsf@be-well.ilk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44bry1ngdc.fsf@be-well.ilk.org> User-Agent: Mutt/1.4i Subject: Re: how to know if there is a cd inside the cdwriter X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2003 06:06:45 -0000 David Rio 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