Re: Revised scripts

Torsten Veller <[email protected]>
Newsgroups gmane.mail.bogofilter.devel
Message-ID <[email protected]>
* David Relson <[email protected]>:

> # 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
[...]
_______________________________________________
Bogofilter-dev mailing list
[email protected]
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.