summaryrefslogtreecommitdiffstats
path: root/debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db
diff options
context:
space:
mode:
Diffstat (limited to 'debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db')
-rw-r--r--debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db b/debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db
new file mode 100644
index 00000000..1c4948f7
--- /dev/null
+++ b/debian/htdig/htdig-3.2.0b6/contrib/multidig/new-db
@@ -0,0 +1,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