-#! /bin/sh
+#! @SHELL@
#
-# $Id: amverify.sh.in,v 1.35 2006/03/16 17:32:32 ktill Exp $
+# $Id: amverify.sh.in,v 1.38 2006/07/25 19:00:56 martinea Exp $
#
# (C) 1996 by ICEM Systems GmbH
# Author: Axel Zinser (fifi@icem.de)
}
getparm() {
- $AMGETCONF $CONFIG $1 2>/dev/null | grep -v BUGGY
+ $AMGETCONF $CONFIG $1 2>/dev/null
}
sendreport() {
cd @AMANDA_TMPDIR@ || exit 1
TEMP=@AMANDA_TMPDIR@/amverify.$$
-trap 'rm -fr $TEMP' 0
+trap 'rm -fr $TEMP' EXIT
if ( umask 077 ; mkdir $TEMP ) ; then
:
else
TAPELIST=
EXITSTAT=$TEMP/amrecover.exit; rm -rf $EXITSTAT
-trap 'report "aborted!"; echo "aborted!" >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' 1 2 3 4 5 6 7 8 10 12 13 14 15
+trap 'report "aborted!"; echo "aborted!" >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' EXIT
$Echoe "Defects file is $DEFECTS"
report "amverify $CONFIG"
fi
report "Using device $DEVICE"
$Echon "Waiting for device to go ready..."
- until eval $DEVICE_READY >/dev/null 2>&1; do
+ count=1800
+ until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
+ [ count -lt 0 ] \
+ && report "Device not ready" \
+ && report "`cat $TEMP/ammt.out`" \
+ && report cat $TEMP/ammt.out >> $DEFECTS \
+ && break;
sleep 3
+ count=`expr $count - 3`
done
$Echon "Rewinding..."
ERRORS=0
if [ $Echon = echon ]; then
$Echon "Waiting for device to go ready..."
fi
- until eval $DEVICE_READY >/dev/null 2>&1; do
+ count=1800
+ until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
+ [ count -lt 0 ] \
+ && report "Device not ready" \
+ && report "`cat $TEMP/ammt.out`" \
+ && report cat $TEMP/ammt.out >> $DEFECTS \
+ && break;
sleep 3
+ count=`expr $count - 3`
done
if [ $Echon = echon ]; then
$Echon "Reading..."