#!/bin/sh
#
-# Cleanup left over files -- both before and after test run
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
#
-scripts/cleanup
-
-if ! test x@autochanger@ = x/dev/null; then
- drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x2; then
- bin/mtx-changer @autochanger@ unload
- bin/mtx-changer @autochanger@ load 2
- fi
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
-fi
-
#
-# If we have an autochanger always load tape in slot 1
+# Cleanup left over files -- both before and after test run
#
-if ! test x@autochanger@ = x/dev/null; then
- drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x1; then
- bin/mtx-changer @autochanger@ unload
- bin/mtx-changer @autochanger@ load 1
- fi
-fi
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
+. scripts/functions
+
+scripts/cleanup
+scripts/prepare-two-tapes