-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
- bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1
+if test x@autochanger@ != x/dev/null; then
+ slot=`$scripts/@changer_script@ @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"
+ $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive1@ 1
+ fi
+ slot=`$scripts/@changer_script@ @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"
+ $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ 0