| 1 |
#!@BASH@ |
| 2 |
|
| 3 |
# |
| 4 |
# new-collect 1.1 |
| 5 |
# |
| 6 |
# Copyright (c) 1998-2000 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 |
# new-collect <collection> |
| 14 |
# |
| 15 |
# Creates a new database directory and conf file with given name |
| 16 |
# Updates the global collect.list file |
| 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: new-collect \<collection\> |
| 26 |
exit |
| 27 |
fi |
| 28 |
|
| 29 |
# Add the new collection to the collect.list file |
| 30 |
echo ${1:?You need to specify a collection} >>$COLLECT_LIST |
| 31 |
|
| 32 |
# Now make the appropriate database directory |
| 33 |
mkdir $DB_BASE/$1 |
| 34 |
|
| 35 |
# And make a copy of the default (db.conf) conf file for the DB |
| 36 |
# Use sed to replace @DATABASE@ with the name of the database |
| 37 |
sed -e s%@DATABASE@%$1% $DB_CONF >$CONFIG_DIR/$1.conf |
| 38 |
# And make a blank file for the ${start_urls} directive |
| 39 |
touch $DB_BASE/$1/$1.collect |