#!/bin/sh
#
# Developed by David Rosenthal (davidr@shamash.org)
#
#
# 1.Log in as the user you run ListProc under, typically "server". 
#
# 2.Copy the corrupted $LPDIR/users.db to a safe location for future
# reference (this is the reverse database which revdb actually creates).
#
#	cp $LPDIR/users.db $LPDIR/users.db.bak
#
# 3.Create a file called $LPDIR/support/loop.revdb with this
# script. Be sure to edit the third line (by replacing
# /path/to/your/ListProc/ with the directory which contains your ListProc).
#
# 4. Shut down your ListProc. 
#
#	$LPDIR/start -k
#
# 5. Run the script
#
# 6. Restart ListProc
#
#	$LPDIR/start
#

#Define this variable appropriately:
LPDIR=/path/to/your/ListProc/

for list in `grep '^list' $LPDIR/config | awk '{print $2}'` ; do
echo "Updating the reverse database for $list"
$LPDIR/revdb update $list
done
