]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/cleanup-2drive.in
Port missing RestoreObject Plugin Config code from BEE.
[bacula/bacula] / regress / scripts / cleanup-2drive.in
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Cleanup left over files -- both before and after test run
9 #
10 . scripts/functions
11 scripts/cleanup
12
13 if test x@autochanger@ != x/dev/null; then
14    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1`
15    echo "Slot $slot in drive 1"
16    if test x$slot != x0 ; then
17       echo "unload slot $slot in drive 1"
18       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive1@ 1
19    fi
20    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0`
21    echo "Slot $slot in drive 0"
22    if test x$slot != x0 ; then
23       echo "unload slot $slot in drive 0"
24       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ 0
25    fi
26
27
28    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1`
29    if test x$slot != x$SLOT2; then
30       echo "load slot $SLOT2 in drive 1"
31       $scripts/@changer_script@ @autochanger@ load $SLOT2 @tape_drive1@ 1
32    fi
33    echo "WEOF drive 1"
34    init_drive @tape_drive1@
35
36    echo "unload slot $SLOT2 in drive 1"
37    $scripts/@changer_script@ @autochanger@ unload $SLOT2 @tape_drive1@ 1
38
39    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0`
40    echo "Slot $slot in drive 0"
41    if test x$slot != x$SLOT1; then
42       echo "load slot $SLOT1 in drive 0"
43       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0
44    fi
45    echo "WEOF drive 0"
46    init_drive @tape_drive@
47
48    echo "unload slot $SLOT1 from drive 0"
49    $scripts/@changer_script@ @autochanger@ unload $SLOT1 @tape_drive@ 0
50 fi