]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/cleanup-2drive.in
Update
[bacula/bacula] / regress / scripts / cleanup-2drive.in
1 #!/bin/sh
2 #
3 # Cleanup left over files -- both before and after test run
4 #
5 scripts/cleanup
6
7 if test x@autochanger@ != x/dev/null; then
8    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
9    echo "Slot $slot in drive 1"
10    if test x$slot != x0 ; then
11       echo "unload slot $slot in drive 1"
12       bin/mtx-changer @autochanger@ unload $slot @tape_drive1@ 1
13    fi
14    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
15    echo "Slot $slot in drive 0"
16    if test x$slot != x0 ; then
17       echo "unload slot $slot in drive 0"
18       bin/mtx-changer @autochanger@ unload $slot @tape_drive@ 0
19    fi
20
21
22    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
23    if test x$slot != x2; then
24       echo "load slot 2 in drive 1"
25       bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1
26    fi
27    echo "WEOF drive 1"
28    mt -f @tape_drive1@ rewind
29    mt -f @tape_drive1@ weof
30    echo "unload slot 2 in drive 1"
31    bin/mtx-changer @autochanger@ unload 2 @tape_drive1@ 1
32
33    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
34    echo "Slot $slot in drive 0"
35    if test x$slot != x1; then
36       echo "load slot 1 in drive 0"
37       bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
38    fi
39    echo "WEOF drive 0"
40    mt -f @tape_drive@ rewind
41    mt -f @tape_drive@ weof
42    echo "unload slot 1 from drive 0"
43    bin/mtx-changer @autochanger@ unload 1 @tape_drive@ 0
44 fi