| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# |
| 4 |
# updatedig |
| 5 |
# |
| 6 |
# This is a script to update the search database for ht://Dig. |
| 7 |
# Copyright (c) 1998 David Robley [email protected] |
| 8 |
# |
| 9 |
if [ "$1" = "-v" ]; then |
| 10 |
verbose=-v |
| 11 |
fi |
| 12 |
|
| 13 |
# -a: run using alternate work files so search can still be done during index run |
| 14 |
# -t: create an ASCII version of document database in doc_list as specified |
| 15 |
# in the config file |
| 16 |
# -s: print stats after completion |
| 17 |
/web/webdocs/htdig/bin/htdig -a -t $verbose -s |
| 18 |
/web/webdocs/htdig/bin/htmerge -a $verbose -s |
| 19 |
/web/webdocs/htdig/bin/htnotify $verbose |
| 20 |
|
| 21 |
# Because the -a switch creates alternate work files, but doesn't seem to move |
| 22 |
# them into the correct place, we will do it here. |
| 23 |
mv /web/webdocs/htdig/db/db.docdb /web/webdocs/htdig/db/db.docdb.old |
| 24 |
mv /web/webdocs/htdig/db/db.docdb.work /web/webdocs/htdig/db/db.docdb |
| 25 |
|
| 26 |
mv /web/webdocs/htdig/db/db.docs.index /web/webdocs/htdig/db/db.docs.index.old |
| 27 |
mv /web/webdocs/htdig/db/db.docs.index.work /web/webdocs/htdig/db/db.docs.index |
| 28 |
|
| 29 |
mv /web/webdocs/htdig/db/db.wordlist /web/webdocs/htdig/db/db.wordlist.old |
| 30 |
mv /web/webdocs/htdig/db/db.wordlist.work /web/webdocs/htdig/db/db.wordlist |
| 31 |
|
| 32 |
mv /web/webdocs/htdig/db/db.words.gdbm /web/webdocs/htdig/db/db.words.gdbm.old |
| 33 |
mv /web/webdocs/htdig/db/db.words.gdbm.work /web/webdocs/htdig/db/db.words.gdbm |
| 34 |
|
| 35 |
# |
| 36 |
# Only create the endings database if it doesn't already exist. |
| 37 |
# This database is static, so even if pages change, this database will not |
| 38 |
# need to be rebuilt. |
| 39 |
# |
| 40 |
if [ ! -f /web/webdocs/htdig/common/word2root.gdbm ] |
| 41 |
then |
| 42 |
/web/webdocs/htdig/bin/htfuzzy $verbose endings |
| 43 |
fi |
| 44 |
|
| 45 |
# This next needs to be run if synonyms are added/modified/removed |
| 46 |
# Guess the best way would be to delete synonyms.gdbm before |
| 47 |
# running this script?? |
| 48 |
|
| 49 |
if [ ! -f /web/webdocs/htdig/common/synonyms.gdbm ] |
| 50 |
then |
| 51 |
/web/webdocs/htdig/bin/htfuzzy $verbose synonyms |
| 52 |
fi |
| 53 |
# end updatedig |