| 1 | #!/bin/sh |
| 2 | # update mnogosearch database |
| 3 | # |
| 4 | # to configure mnogosearch, see /etc/mnogosearch |
| 5 | # and /usr/share/doc/mnogosearch-* |
| 6 | # |
| 7 | MAINCONFIG=/etc/mnogosearch/indexer.conf |
| 8 | |
| 9 | if [ ! -f $MAINCONFIG ]; then |
| 10 | # no config: exit quietly |
| 11 | exit 0 |
| 12 | fi |
| 13 | |
| 14 | if [ ! -x /usr/bin/indexer ]; then |
| 15 | echo "can't execute /usr/bin/indexer" >&2 |
| 16 | exit 1 |
| 17 | fi |
| 18 | |
| 19 | # are we called by the correct user? |
| 20 | if [ ! -O /var/lib/mnogosearch ]; then |
| 21 | echo "indexing can only be done by the mnogosearch user" >&2 |
| 22 | exit 1 |
| 23 | fi |
| 24 | |
| 25 | BASICOPTIONS="-v 0 -d $MAINCONFIG" |
| 26 | |
| 27 | # crawl the URLs |
| 28 | /usr/bin/indexer $BASICOPTIONS --crawl -b -e |
| 29 | # create a search index |
| 30 | /usr/bin/indexer $BASICOPTIONS --index |
| 31 | # create word statistics for suggestions |
| 32 | /usr/bin/indexer $BASICOPTIONS --wordstat |