3 # check tapelist against database and vice versa
7 exec_prefix=@exec_prefix@
9 libexecdir=@libexecdir@
11 ConfigDir=@CONFIG_DIR@
13 PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
16 USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
17 if test "$USE_VERSION_SUFFIXES" = "yes"; then
31 if [ "$Config" = "" ]; then
32 log "usage: ${Program} <config>"
37 # Check if the configuration directory exists. Make sure that the
38 # necessary files can be found, such as amanda.conf and tapelist.
40 if [ ! -d ${ConfigDir}/${Config} ]; then
41 log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
44 (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
45 cd ${ConfigDir}/${Config}
46 if [ ! -r amanda.conf ]; then
47 log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
51 # Get the location and name of the tapelist filename. If tapelist is not
52 # specified in the amanda.conf file, then use tapelist in the config
54 TapeList=`amgetconf${SUF} tapelist`
55 if [ ! "$TapeList" ]; then
56 TapeList="$ConfigDir/$Config/tapelist"
58 if [ ! -r $TapeList ]; then
59 log "${Program}: $TapeList not found or is not readable."
63 Amadmin=$sbindir/amadmin$SUF
66 && echo "$Amadmin not found or not executable" >&2 \
69 $Amadmin $Config export \
72 [ "$LINE" = "" ] && continue
78 [ "$TAPE" = "" ] && continue
79 grep " $TAPE " $TapeList 2>/dev/null >/dev/null
81 && echo "Tape $TAPE missing in $TapeList"