try using --without-ipv6
[debian/amanda] / server-src / amverify.sh.in
index 451da620e326402a210325a1c8bc8021def936b8..38859c374301aee51dcae6267024e3aa8ac1b81f 100644 (file)
@@ -331,7 +331,7 @@ fi
 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
@@ -343,7 +343,7 @@ REPORT=$TEMP/report; rm -f $REPORT
 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"
@@ -373,8 +373,15 @@ while [ $SLOT -lt $SLOTS ]; do
        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
@@ -424,8 +431,15 @@ while [ $SLOT -lt $SLOTS ]; do
                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..."
@@ -529,4 +543,7 @@ done
 
 sendreport
 
+rm -fr $TEMP
+trap - EXIT
+
 exit 0