9 # try to hit all the possibilities here
11 exec_prefix=@exec_prefix@
13 libexecdir=@libexecdir@
14 debugdir=@AMANDA_DBGDIR@
16 PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
21 logfile=$debugdir/changer.debug
28 USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
29 if test "$USE_VERSION_SUFFIXES" = "yes"; then
42 changerfile=`amgetconf$SUF changerfile`
44 tapedev=`amgetconf$SUF tapedev`
46 cleanfile=$changerfile-clean
47 accessfile=$changerfile-access
48 slotfile=$changerfile-slot
49 [ ! -f $cleanfile ] && echo 0 > $cleanfile
50 [ ! -f $accessfile ] && echo 0 > $accessfile
51 [ ! -f $slotfile ] && echo $firstslot > $slotfile
52 cleancount=`cat $cleanfile`
53 accesscount=`cat $accessfile`
63 # handle special slots...
66 current) newslot=$slot ; load=true;;
67 next) newslot=`expr $slot + 1`; load=true;;
68 advance) newslot=`expr $slot + 1`; load=false;;
69 prev) newslot=`expr $slot - 1`; load=true;;
70 first) newslot=0 ; load=true;;
71 last) newslot=-1 ; load=true;;
72 *) newslot=$2 ; load=true;;
77 newslot=`expr $totalslots - 1`
80 if [ $totalslots -le $newslot ]
84 echo $newslot > $changerfile-slot
90 echo $slot $totalslots 1