#!/bin/sh -u # # Wrapper for bogofilter to subvert the fsync()-happy nature of its db backend. # - Cameron Simpson 17mar2006 # # : ${SHMFS:=/dev/shm} : ${USER:=`whoami || id -un`} shmbf=$SHMFS/$USER/bogofilter bfdir=${BOGOFILTER:=$HOME/.bogofilter} owf=$bfdir/wordlist.db swf=$shmbf/wordlist.db [ -s "$owf" -a ! -s "$swf" ] \ && { [ -d "$shmbf/." ] || needdir "$shmbf"; } \ && cp -- "$owf" "$swf" if [ -s "$swf" ] then BOGOFILTER_DIR=$shmbf export BOGOFILTER_DIR fi exec bogofilter ${1+"$@"}