finish incomplete fix for utf8 on index pages
[mharc.git] / bin / mk-search-index
CommitLineData
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
30if [ ! -z "$GATEWAY_INTERFACE" ]; then
31 echo "CGI use FORBIDDEN!"
32 exit 1
33fi
34
35if [ $# -ne 1 ]; then
36 echo "Invalid invocation."
37 exit 1
38fi
39list=$1
40
41PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin; export PATH
42BASEDIR=`dirname $0`
43
44# Load configuration
45. $BASEDIR/../lib/config.sh
46
47# Sanity checks
48if [ ! -e "$MKNMZ_RC" ]; then
49 echo "$MKNMZ_RC does not exist!"
50 exit 1
51fi
52if [ ! -d "$MKNMZ_TMPL_DIR" ]; then
53 echo "$MKNMZ_TMPL_DIR is not a directory!"
54 exit 1
55fi
56if [ ! -d "$HTML_DIR/$list" ]; then
57 echo "$HTML_DIR/$list is not a directory!"
58 exit 1
59fi
60
61$MKNMZ --mhonarc \
62 -f "$MKNMZ_RC" \
63 -T "$MKNMZ_TMPL_DIR" \
64 -O "$HTML_DIR/$list" \
65 "$HTML_DIR/$list"