3 # check tapelist against database and vice versa
7 exec_prefix="@exec_prefix@"
9 amlibexecdir="@amlibexecdir@"
10 . "${amlibexecdir}/amanda-sh-lib.sh"
12 ConfigDir=@CONFIG_DIR@
14 # add sbin and ucb dirs
15 PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
18 USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
19 if test "$USE_VERSION_SUFFIXES" = "yes"; then
33 if [ "$Config" = "" ]; then
34 log "usage: ${Program} <config>"
40 # Check if the configuration directory exists. Make sure that the
41 # necessary files can be found, such as amanda.conf and tapelist.
43 if [ ! -d ${ConfigDir}/${Config} ]; then
44 log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
47 (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
48 cd ${ConfigDir}/${Config}
49 if [ ! -r amanda.conf ]; then
50 log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
54 # Get the location and name of the tapelist filename. If tapelist is not
55 # specified in the amanda.conf file, then use tapelist in the config
57 TapeList=`amgetconf${SUF} $Config tapelist "@$"`
58 if [ ! "$TapeList" ]; then
59 TapeList="$ConfigDir/$Config/tapelist"
61 if [ ! -r $TapeList ]; then
62 log "${Program}: $TapeList not found or is not readable."
66 Amadmin=$sbindir/amadmin$SUF
69 && echo `_ '%s was not found' $Amadmin` >&2 \
72 && echo `_ '%s is not executable' $Amadmin` >&2 \
75 $Amadmin $Config export "$@"\
78 [ "$LINE" = "" ] && continue
84 [ "$TAPE" = "" ] && continue
85 grep " $TAPE " $TapeList 2>/dev/null >/dev/null
87 && echo `_ 'Tape %s missing in %s' "$TAPE" "$TapeList"`