[Mailman-Users] List Sync Problem

Hello,
I have compiled a script based upon the great feedback from Jon Carnes and
the Mailman FAQ that generates a "main" which consists of all the
subscribers from a set of lists. This script then syncs this list with a
.htpasswd file. My script works fine via a hourly cron job minus one
glitch. Ever few days or so (this does not happen at any consistent time)
when the script is filtering through the list set, it come back with zero
list subscribers. Following this, the script then updates the main list.
Because It comes back with zero subscribers, the main list's members are all
removed. An hour later when the job is run again, the script locates all
the expected list members from the list set and then re-subscribes everyone.
The main problem with this is that all the re-subscribed members are
assigned new passwords, ultimately making my attempt to sync this list to a
.htpasswd file unfruitful as the list members can never be certain of what
their password is.
I have included the script below. I don't think the problem is with the
script, but perhaps has something to do with Mailman. Any ideas?
Thank you,
Michael Caplan
Institute for Social Ecology
http://www.social-ecology.org/
#!/usr/local/bin/bash
# Sync the ise-all mailling list
# The list includes everyone on an ISE project mailling list.
# Users on the ise-all list are then synced with the htpass file
# for the ISE "internal" web page
#
# create an empty file
echo " " >/tmp/ise_list
#
# dump out all lists names that contain the word pasus, but
# be sure to not include the "-all" list, since that is the list
# that we are recreating with this script
LISTS="`/usr/local/mailman/bin/list_lists | grep -i ise | \
grep -vi food | \
grep -vi all | \
grep -vi new-test | \
grep -vi organise | \
awk '{ print $1 }'`"
for i in $LISTS
do
# dump all the user emails out to a file for all the pasus lists
/usr/local/mailman/bin/list_members $i >>/tmp/ise_list
done
#
# this sorts the list and removes duplicate entries
cat /tmp/ise_list |sort -u >/tmp/ise-all_list
#get rid of archive addresses
cat /tmp/ise-all_list | grep -vi archive > /tmp/ise-all_list
### the above step is really unnecessary as "sync_members" already
### does this automatically - still I like a clean orderly list...
#
# feed the list of all pasus users into the "_all" list
# Note: welcome messages are turned off for this list.
/usr/local/mailman/bin/sync_members -f /tmp/ise-all_list ise-all
>/dev/null
#
# Take only pictures, leave only foot prints...
rm /tmp/ise_list
rm /tmp/ise-all_list
#Sync list with htpasswd file
/usr/local/apache/bin/htpasswd -cb /path/to/.htaccess.new user pass
for i in `/usr/local/mailman/bin/list_members ise-all`
do
PASS=`strings /usr/local/mailman/lists/ise-all/config.db |grep -i -A1
$i |head -5 |tail -1 | sed 's/s$//' `
/usr/local/apache/bin/htpasswd -b /path/to/.htaccess.new $i $PASS
done
# replace the .htaccess.mylist file used for list users web access to this
site.
# This gets rid of the dummy line used to create the passwd file, but you
# could just start with an empty file...
cat /path/to/.htaccess.new > /path/to/.htpasswd