summaryrefslogtreecommitdiff
path: root/localrundig
blob: e1928a08aef8fabd8ae31ada5fb3d133bc3f1a39 (plain)
  1. #!/bin/sh
  2. #
  3. # rundig
  4. #
  5. # $Id: localrundig,v 1.1 2002-01-21 00:18:07 jonas Exp $
  6. #
  7. # This is a sample script to create a search database for ht://Dig.
  8. #
  9. DBDIR=/var/lib/htdig
  10. COMMONDIR=/etc/htdig
  11. BINDIR=/usr/bin
  12. # To help debug problems, try running rundig -vvv
  13. # This will add lots of debugging output to all of the programs
  14. stats= opts= alt= init=
  15. for arg
  16. do
  17. case "$arg" in
  18. -a) alt="$arg" ;;
  19. -s) stats="$arg" ;;
  20. -i) init="$arg" ;;
  21. *) opts="$opts $arg" ;; # e.g. -v or -c config
  22. esac
  23. done
  24. #
  25. # Set the TMPDIR variable if you want htmerge to put files in a location
  26. # other than the default. This is important if you do not have enough
  27. # disk space for the big sort that htmerge runs. Also, be aware that
  28. # on some systems, /tmp is a memory mapped filesystem that takes away
  29. # from virtual memory.
  30. #
  31. TMPDIR=${TMPDIR:-$DBDIR}
  32. export TMPDIR
  33. $BINDIR/htdig $init $opts $stats $alt
  34. LC_COLLATE=C $BINDIR/htmerge $opts $stats $alt
  35. case "$alt" in
  36. -a)
  37. ( cd $DBDIR && test -f db.docdb.work &&
  38. for f in *.work
  39. do
  40. mv -f $f `basename $f .work`
  41. done ) ;;
  42. esac
  43. # If you're low on disk space and you don't mind completely reindexing
  44. # every time you run this script, you can always
  45. # rm $DBDIR/db.wordlist
  46. # OR
  47. # If you'd rather run update digs all the time with the minimal databases
  48. # Keep only the following files (and don't call htdig with -i):
  49. # db.docdb, db.docdb.work, db.docs.index, db.wordlist.work, db.words.db
  50. $BINDIR/htnotify $opts
  51. # If you want to use the soundex and (or) metaphone fuzzy matchings,
  52. # Uncomment the following line
  53. # $BINDIR/htfuzzy $opts soundex metaphone
  54. #
  55. # Create the endings and synonym databases if they don't exist
  56. # or if they're older than the files they're generated from.
  57. # These databases are semi-static, so even if pages change,
  58. # these databases will not need to be rebuilt.
  59. #
  60. #if [ "`ls -t $COMMONDIR/english.0 $COMMONDIR/word2root.db 2>/dev/null | sed 1q`" = \
  61. # "$COMMONDIR/english.0" ]
  62. #then
  63. # $BINDIR/htfuzzy $opts endings
  64. #fi
  65. #
  66. #if [ "`ls -t $COMMONDIR/synonyms $COMMONDIR/synonyms.db 2>/dev/null | sed 1q`" = \
  67. # "$COMMONDIR/synonyms" ]
  68. #then
  69. # $BINDIR/htfuzzy $opts synonyms
  70. #fi