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"
26 if [ "$Config" = "" ]; then
27 log "usage: ${Program} <config>"
33 # Check if the configuration directory exists. Make sure that the
34 # necessary files can be found, such as amanda.conf and tapelist.
36 if [ ! -d ${ConfigDir}/${Config} ]; then
37 log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
40 (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
41 cd ${ConfigDir}/${Config}
42 if [ ! -r amanda.conf ]; then
43 log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
47 # Get the location and name of the tapelist filename. If tapelist is not
48 # specified in the amanda.conf file, then use tapelist in the config
50 TapeList=`amgetconf${SUF} $Config tapelist "@$"`
51 if [ ! "$TapeList" ]; then
52 TapeList="$ConfigDir/$Config/tapelist"
54 if [ ! -r $TapeList ]; then
55 log "${Program}: $TapeList not found or is not readable."
59 Amadmin=$sbindir/amadmin
62 && echo `_ '%s was not found' $Amadmin` >&2 \
65 && echo `_ '%s is not executable' $Amadmin` >&2 \
68 $Amadmin $Config export "$@"\
71 [ "$LINE" = "" ] && continue
77 [ "$TAPE" = "" ] && continue
78 grep " $TAPE " $TapeList 2>/dev/null >/dev/null
80 && echo `_ 'Tape %s missing in %s' "$TAPE" "$TapeList"`