#!/bin/sh
# $Id: getlist,v 1.7 1998/05/28 01:04:20 um Exp um $

echo "Getting mixmaster list. Please wait ..."

for LIST in mix.list type2.list pubring.mix
do
 rm -f $LIST.tmp
 for URL in `grep "^$LIST " urls | sed 's/^.* //'`
 do
  if [ ! -f $LIST.tmp ]
  then
  if echo $URL | grep '^finger:' >/dev/null
  then
   finger `echo $URL | sed 's/finger://'` | grep -v '^\[.*\]' >$LIST.tmp
  else
   lynx -dump $URL >$LIST.tmp
  fi
  if [ "$LIST" = "mix.list" ]
  then
   PATTERN="^--------------------------------------------$"
  else
   PATTERN=" [0-9a-f]* 2"
  fi
  if grep "$PATTERN" $LIST.tmp >/dev/null
  then
   echo "Got $LIST from $URL."
  else
   rm -f $LIST.tmp
  fi 
  fi
 done
 if [ -f $LIST.tmp ]
 then
  mv $LIST.tmp $LIST
 else
  echo "Could not get $LIST."
 fi
done
