X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Fscripts%2Fcleanup-2drive.in;h=32b27c019e0fd439ce706fa2ee805d93dde619c2;hb=545ee5b934384ef66e1ce719cd5be6776583bc57;hp=1801abb5062a4c3b55ad5c184b9a6b54f4b253c2;hpb=66e5e7d73d18c1868b2241608a499c416ff5cf7c;p=bacula%2Fbacula diff --git a/regress/scripts/cleanup-2drive.in b/regress/scripts/cleanup-2drive.in index 1801abb506..32b27c019e 100755 --- a/regress/scripts/cleanup-2drive.in +++ b/regress/scripts/cleanup-2drive.in @@ -4,27 +4,41 @@ # scripts/cleanup -if ! test x@autochanger@ = x/dev/null; then - drive=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1` - if ! test x$drive = x2; then - bin/mtx-changer @autochanger@ unload $drive @tape_drive1@ 1 +if test x@autochanger@ != x/dev/null; then + slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1` + echo "Slot $slot in drive 1" + if test x$slot != x0 ; then + echo "unload slot $slot in drive 1" + bin/mtx-changer @autochanger@ unload $slot @tape_drive1@ 1 + fi + slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0` + echo "Slot $slot in drive 0" + if test x$slot != x0 ; then + echo "unload slot $slot in drive 0" + bin/mtx-changer @autochanger@ unload $slot @tape_drive@ 0 + fi + + + slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1` + if test x$slot != x2; then + echo "load slot 2 in drive 1" bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1 fi + echo "WEOF drive 1" mt -f @tape_drive1@ rewind mt -f @tape_drive1@ weof -fi + echo "unload slot 2 in drive 1" + bin/mtx-changer @autochanger@ unload 2 @tape_drive1@ 1 - -# -# If we have an autochanger always load tape in slot 1 -# -if ! test x@autochanger@ = x/dev/null; then - drive=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0` - if ! test x$drive = x1; then - bin/mtx-changer @autochanger@ unload $drive @tape_drive@ 0 + slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0` + echo "Slot $slot in drive 0" + if test x$slot != x1; then + echo "load slot 1 in drive 0" bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0 fi + echo "WEOF drive 0" + mt -f @tape_drive@ rewind + mt -f @tape_drive@ weof + echo "unload slot 1 from drive 0" + bin/mtx-changer @autochanger@ unload 1 @tape_drive@ 0 fi - -mt -f @tape_drive@ rewind -mt -f @tape_drive@ weof