summaryrefslogtreecommitdiffstats
path: root/debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db
blob: 1c4948f78f04cd1379cf5754bd4318f254ed74e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!@BASH@

#
# new-db 1.1
#
# Copyright (c) 1998-1999 The ht://Dig Group
# Distributed under the terms of the GNU General Public License (GPL)
#   version 2 or later.
# for the ht://Dig search system http://www.htdig.org/
# and the multidig script system http://www.htdig.org/contrib/scripts/
#
# syntax:
# new-db <db>
#
# Creates a new database directory and conf file with given name 
# Updates the global db.list file
#

# You may need to set the following:
MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf
source $MULTIDIG_CONF

# Catch people who don't supply an argument
if [ "$1" = "" ]; then
    echo Syntax: new-db \<db\>
    exit
fi

# Add the new database to the db.list file
echo ${1:?You need to specify a database} >>$DB_LIST

# Now make the appropriate database directory
mkdir $DB_BASE/$1

# And make a copy of the default (db.conf) conf file for the DB
# Use sed to replace @DATABASE@ with the name of the database
sed -e s%@DATABASE@%$1% $DB_CONF >$CONFIG_DIR/$1.conf
# And make a blank file for the ${start_urls} directive
touch $DB_BASE/$1/$1.urls