]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/prepare-two-tapes.in
ebl Update for faketape driver
[bacula/bacula] / regress / scripts / prepare-two-tapes.in
1 #!/bin/sh
2 #
3 # Cleanup left over files -- both before and after test run
4 #
5
6 . scripts/functions
7
8 scripts/cleanup
9
10 if test x@autochanger@ != x/dev/null; then
11    slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
12    if test "x${slot}" != "x$SLOT2"; then
13       bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
14       bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
15    fi
16    mt -f @tape_drive@ rewind
17    mt -f @tape_drive@ weof
18 fi
19
20
21 #
22 # If we have an autochanger always load tape in slot 1
23 #
24 if test x@autochanger@ != x/dev/null; then
25    slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
26    if test "x${slot}" != "x$SLOT1"; then
27       bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
28       bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
29    fi
30 fi
31
32 if test a$USE_FAKETAPE = a; then
33    mt -f @tape_drive@ rewind
34    mt -f @tape_drive@ weof
35 else
36    cp /dev/null @tape_drive@
37 fi