#!/bin/sh
#
# bogoupgrade.sh
#

DIR="."
NEW="wordlist.db"

rm -f $DIR/$NEW

# Display several tokens
bogoutil -w $DIR .MSG_COUNT david mark

# Create new wordlist

bogoutil -d $DIR/spamlist.db | awk '{print $1 " " $2 " 0 " $3}' | bogoutil -l $DIR/$NEW.tmp
bogoutil -d $DIR/goodlist.db | awk '{print $1 " 0 " $2 " " $3}' | bogoutil -l $DIR/$NEW.tmp

# Compact it

bogoutil -d $DIR/$NEW.tmp | bogoutil -l $DIR/$NEW

# Display the tokens again 
# (values should match)
bogoutil -w $DIR .MSG_COUNT david mark

rm -f $DIR/$NEW.tmp

