]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/cleanup-tape.in
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / scripts / cleanup-tape.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, then load $SLOT1 into drive and    
9 #   write an EOF on it.
10 #
11
12 . scripts/functions
13
14 scripts/cleanup
15
16 # init slot for vtape driver
17 init_slot @tape_drive@ $SLOT1
18
19 if test x@autochanger@ != x/dev/null; then
20    slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
21    case $slot in
22    0)
23       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
24       ;;
25    $SLOT1)
26       ;;
27    *)
28       $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
29       $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
30       ;;
31   esac
32 fi
33
34 init_drive @tape_drive@