]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/prepare-two-tapes.in
ebl tweak regress scripts to be able to change binary location
[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 # Write an EOF on tape in slot $SLOT1  and  on tape in $SLOT2
6
7 . scripts/functions
8
9 scripts/cleanup
10
11 #
12 # init first of two slots
13 # optimize so we don't unnecessarily unload and load slots
14 #
15 if test x@autochanger@ != x/dev/null; then
16    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
17    case $slot in
18    0)
19       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
20       init_drive @tape_drive@
21       slot=$SLOT1
22       ;;
23    $SLOT1)
24       init_drive @tape_drive@
25       slot=$SLOT1
26       ;;
27    $SLOT2)
28       init_drive @tape_drive@
29       slot=$SLOT2
30       ;;
31    *)
32       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
33       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
34       init_drive @tape_drive@
35       slot=$SLOT1
36       ;;
37   esac
38
39 # init the other slot
40   case $slot in
41    $SLOT1)
42       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
43       $scripts/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
44       init_drive @tape_drive@
45       ;;
46    $SLOT2)
47       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
48       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
49       init_drive @tape_drive@
50       ;;
51    esac
52 fi