]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/cleanup-2drive.in
Update 2drive stuff
[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    drive=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
9    if ! test x$drive = x2; then
10       bin/mtx-changer @autochanger@ unload $drive @tape_drive1@ 1
11       bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1
12    fi
13    mt -f @tape_drive1@ rewind
14    mt -f @tape_drive1@ weof
15    bin/mtx-changer @autochanger@ unload 2 @tape_drive1@ 1
16 fi
17
18
19 #
20 # If we have an autochanger always load tape in slot 1
21 #
22 if ! test x@autochanger@ = x/dev/null; then
23    drive=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
24    if ! test x$drive = x1; then
25       bin/mtx-changer @autochanger@ unload $drive @tape_drive@ 0
26       bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
27    fi
28 fi
29
30 mt -f @tape_drive@ rewind
31 mt -f @tape_drive@ weof
32 bin/mtx-changer @autochanger@ unload 1 @tape_drive@ 0