Revised scripts

Torsten Veller ml-en at veller.net
Mon May 9 18:43:33 CEST 2005


* David Relson <relson at osagesoftware.com>:

> # Usage: bf_resize [DIR]
> #   DIR defaults to . and is the path of a bogofilter Berkeley database
> #   environment.
> #
> # This script reads all databases in that directory, calculates a lock
> # size and writes it to DB_CONFIG, then runs recovery to make the change
> # effective.
> 
> set -e
> 
> BOGOHOME=${1:-.}
> 
> if [ ! -d "$BOGOHOME" ] ; then
>     echo $BOGOHOME must be a directory, not a file
>     exit 1
> fi
> 
> # obtain list of database files
> PAGES=0
> DATABASES=`bogofilter -QQ -d "$BOGOHOME" | grep '^wordlist' | cut -f3 -d,`
> if [ ! "$dbs" ] ; then
           ^^^ I think it should be DATABASES?

but when is DATABASES empty?

$ mkdir testdir
$ bogofilter -QQ -d testdir | grep '^wordlist'
wordlist             r,word,testdir/wordlist.db,0

>     echo >&2 "No database files in \"$BOGOHOME\" found"
>     exit 1
> fi
[...]



More information about the bogofilter-dev mailing list