Commit | Line | Data |
---|---|---|
2ea8f66b IK |
1 | #!/bin/sh |
2 | ##--------------------------------------------------------------------------## | |
3 | ## File: | |
4 | ## $Id: mk-search-index,v 1.4 2002/09/13 07:25:55 ehood Exp $ | |
5 | ## Description: | |
6 | ## Create/update search index for list. The name of the | |
7 | ## list is specified on the command-line. | |
8 | ## | |
9 | ## NOTE: This script is probably no longer needed since | |
10 | ## web-archive calls the search indexing tool directly. | |
11 | ##--------------------------------------------------------------------------## | |
12 | ## Copyright (C) 2001-2002 Earl Hood <earl@earlhood.com> | |
13 | ## | |
14 | ## This program is free software; you can redistribute it and/or modify | |
15 | ## it under the terms of the GNU General Public License as published by | |
16 | ## the Free Software Foundation; either version 2 of the License, or | |
17 | ## (at your option) any later version. | |
18 | ## | |
19 | ## This program is distributed in the hope that it will be useful, | |
20 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ## GNU General Public License for more details. | |
23 | ## | |
24 | ## You should have received a copy of the GNU General Public License | |
25 | ## along with this program; if not, write to the Free Software | |
26 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
27 | ## 02111-1307, USA | |
28 | ##--------------------------------------------------------------------------## | |
29 | ||
30 | if [ ! -z "$GATEWAY_INTERFACE" ]; then | |
31 | echo "CGI use FORBIDDEN!" | |
32 | exit 1 | |
33 | fi | |
34 | ||
35 | if [ $# -ne 1 ]; then | |
36 | echo "Invalid invocation." | |
37 | exit 1 | |
38 | fi | |
39 | list=$1 | |
40 | ||
41 | PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin; export PATH | |
42 | BASEDIR=`dirname $0` | |
43 | ||
44 | # Load configuration | |
45 | . $BASEDIR/../lib/config.sh | |
46 | ||
47 | # Sanity checks | |
48 | if [ ! -e "$MKNMZ_RC" ]; then | |
49 | echo "$MKNMZ_RC does not exist!" | |
50 | exit 1 | |
51 | fi | |
52 | if [ ! -d "$MKNMZ_TMPL_DIR" ]; then | |
53 | echo "$MKNMZ_TMPL_DIR is not a directory!" | |
54 | exit 1 | |
55 | fi | |
56 | if [ ! -d "$HTML_DIR/$list" ]; then | |
57 | echo "$HTML_DIR/$list is not a directory!" | |
58 | exit 1 | |
59 | fi | |
60 | ||
61 | $MKNMZ --mhonarc \ | |
62 | -f "$MKNMZ_RC" \ | |
63 | -T "$MKNMZ_TMPL_DIR" \ | |
64 | -O "$HTML_DIR/$list" \ | |
65 | "$HTML_DIR/$list" |