-#!/bin/sh
+#!@SHELL@
#
# Exit Status:
# 0 Alles Ok
# in amanda.conf. For example, if amanda.conf has:
#
# changerfile="/etc/amanda/Dailyset1/CHANGER"
+# or changerfile="/etc/amanda/Dailyset1/CHANGER.conf"
#
# the variables must be in "/etc/amanda/Dailyset1/CHANGER.conf".
+# The ".conf" is appended only if it's not there".
#
# If "changerfile" is a relative path, it is relative to the directory
# that contains amanda.conf. That also happens to be the directory Amanda
SUF=
fi
-DBGFILE=`amgetconf$SUF dbopen.$argv0 2>/dev/null | grep -v BUGGY`
+DBGFILE=`amgetconf$SUF dbopen.$argv0 2>/dev/null`
if [ -z "$DBGFILE" ]
then
DBGFILE=/dev/null # will try this again below
fi
-changerfile=`amgetconf$SUF changerfile 2>/dev/null | grep -v BUGGY`
+changerfile=`amgetconf$SUF changerfile 2>/dev/null`
if [ -z "$changerfile" ]; then
Exit 2 \
"<none>" \
"changerfile must be specified in amanda.conf"
fi
-tape=`amgetconf$SUF tapedev 2>/dev/null | grep -v BUGGY`
+tape=`amgetconf$SUF tapedev 2>/dev/null`
if [ -z "$tape" ]; then
Exit 2 \
"<none>" \
"<none>" \
"tapedev ($tape) may not be the null device"
fi
-TAPE=`amgetconf$SUF changerdev 2>/dev/null | grep -v BUGGY`
+TAPE=`amgetconf$SUF changerdev 2>/dev/null`
if [ -z "$TAPE" ]; then
Exit 2 \
"<none>" \
#### Set up the various config files.
-configfile=$changerfile.conf
+conf_match=`expr "$changerfile" : .\*\.conf\$`
+if [ $conf_match -ge 6 ]; then
+ configfile=$changerfile
+ changerfile=`echo $changerfile | sed 's/.conf$//g'`
+else
+ configfile=$changerfile.conf
+fi
+
cleanfile=$changerfile-clean
accessfile=$changerfile-access
slotfile=$changerfile-slot
if [ $currentslot -lt $firstslot -o $currentslot -gt $lastslot ]; then
currentslot=$firstslot # what "current" will get
fi
- set x $slot_list
- shift # get rid of the "x"
- numslots=$#
+ numslots=`expr $lastslot - $firstslot + 1`
Exit 0 "$currentslot" "$numslots 1 $reader"
return $? # in case we are internal
}