From a953125f3fc744feb542dc0d9a141b9886d96660 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 20 Mar 2008 08:59:13 +0000 Subject: [PATCH] Update prepare-two-tapes for Debian git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6647 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/prepare-two-tapes.in | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/regress/scripts/prepare-two-tapes.in b/regress/scripts/prepare-two-tapes.in index 611fb906f7..3be1775df1 100755 --- a/regress/scripts/prepare-two-tapes.in +++ b/regress/scripts/prepare-two-tapes.in @@ -2,6 +2,16 @@ # # Create two blank tapes # + +# mt status output +# SunOS No Additional Sense +# FreeBSD Current Driver State: at rest. +# Linux ONLINE +# Note Debian has an inferior mt. When no tape is in the +# drive it waits 2 minutes. When a tape is in the drive, it +# prints user unfriendly output. +# + OS=`uname` case ${OS} in SunOS) @@ -10,14 +20,19 @@ case ${OS} in FreeBSD) ready="Current Driver State: at rest." ;; - *) - ready="ONLINE" + Linux) + if test -e /etc/debian_version ; then + ready="drive status" + else + ready="ONLINE" + fi ;; esac + wait_for_drive() { i=0 while [ $i -le 300 ]; do # Wait max 300 seconds - if mt -f $1 status | grep ${ready} >/dev/null 2>&1; then + if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then break fi # debug "Device $1 - not ready, retrying..." -- 2.39.5