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>"
38 # Check if the configuration directory exists. Make sure that the
39 # necessary files can be found, such as amanda.conf and tapelist.
41 if [ ! -d ${ConfigDir}/${Config} ]; then
42 log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
45 (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
46 cd ${ConfigDir}/${Config}
47 if [ ! -r amanda.conf ]; then
48 log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
52 # Get the location and name of the tapelist filename. If tapelist is not
53 # specified in the amanda.conf file, then use tapelist in the config
55 TapeList=`amgetconf${SUF} $Config tapelist "@$"`
56 if [ ! "$TapeList" ]; then
57 TapeList="$ConfigDir/$Config/tapelist"
59 if [ ! -r $TapeList ]; then
60 log "${Program}: $TapeList not found or is not readable."
64 Amadmin=$sbindir/amadmin$SUF
67 && echo "$Amadmin not found or not executable" >&2 \
70 $Amadmin $Config export "$@"\
73 [ "$LINE" = "" ] && continue
79 [ "$TAPE" = "" ] && continue
80 grep " $TAPE " $TapeList 2>/dev/null >/dev/null
82 && echo "Tape $TAPE missing in $TapeList"