| 1 |
#!@BASH@ |
| 2 |
|
| 3 |
# |
| 4 |
# add-collect 1.1 |
| 5 |
# |
| 6 |
# Copyright (c) 1998-1999 The ht://Dig Group |
| 7 |
# Distributed under the terms of the GNU General Public License (GPL) |
| 8 |
# version 2 or later. |
| •9 |
# for the ht://Dig search system https://htdig.sourceforge.net/ |
| 10 |
# and the multidig script system https://htdig.sourceforge.net/contrib/scripts/ |
| 11 |
# |
| 12 |
# syntax: |
| 13 |
# add-collect <collection> |
| 14 |
# |
| 15 |
# Reads new DB in from the standard input (either redirect or paste) |
| 16 |
# Ensures the DB actually exist before adding them to the collection |
| 17 |
# |
| 18 |
|
| 19 |
# You may need to set the following: |
| 20 |
MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf |
| 21 |
source $MULTIDIG_CONF |
| 22 |
|
| 23 |
# Catch people who don't supply an argument |
| 24 |
if [ "$1" = "" ]; then |
| 25 |
echo Syntax: add-colect \<collection\> |
| 26 |
exit |
| 27 |
fi |
| 28 |
|
| 29 |
# Do we actually have a collection named as specified? |
| 30 |
TEST=`grep $1 $COLLECT_LIST` |
| 31 |
if [ "$TEST" = "" ]; then |
| 32 |
# This may become annoying. If so, comment it out! |
| 33 |
echo The collection $1 does not exist. Sorry. |
| 34 |
echo The existing collections are: |
| 35 |
cat $COLLECT_LIST |
| 36 |
else |
| 37 |
# OK, now we have to make sure these are legal db |
| 38 |
for db in `cat /dev/stdin`; do |
| 39 |
DBTEST=`grep $db $DB_LIST` |
| 40 |
if [ "$DBTEST" != "" ]; then |
| 41 |
echo $db >>$DB_BASE/$1/$1.collect |
| 42 |
else |
| 43 |
# This may become annoying. If so, comment it out! |
| 44 |
echo The database $db does not exist. Sorry. |
| 45 |
echo The existing databases are: |
| 46 |
cat $DB_LIST |
| 47 |
fi |
| 48 |
done |
| 49 |
fi |