# CallEm site1 site2 site6 site4 site3 site5  calls sites 1,2,6,4,3,5 in
# that order.  For more than ten sites, add $N entries to the line starting
# with "NameList=".  A site with a busy line gets called again after the
# rest of the list is gone through.  This isn't quite as good as it could be
# as if site1 sends news files, UUXQT registers as "BUSY" until the files are
# unpacked, so even though the call goes through the file transfer that
# might be waiting at site2 does not.  Being a transfer protocol, the
# transfer should take precedence, but apparently not in this version (115).
# Anyway, that's the reason for the long wait looping after a feed.
# Unfortunately the checks needed by those loops precludes having anything
# queued up to go out as the same conditions are met, and Callem thinks that
# UUXQT must be busy unpacking them and loops forever.  BUMMER!

getenv Dialer
if [ "$Dialer"="OFF" ] then setenv Dialer "ON"
   NameList="$1 $2 $3 $4 $5 $6 $7 $8 $9 $10"
   for Name in $NameList
   do uucp:c/uucico -s$Name
      sleep 5 ; Resp=$(LogChkr)
      if [ "$Resp"="FAILED" ] then echo $Name >> tmp:Failed
      else
         while [ -f uuspool:D.* -o -f uuspool:X.* ]
         do sleep 20
         done
      fi
   done

   while [ -f tmp:Failed ]
   do TryAgain=$(cat tmp:Failed) ; rm tmp:Failed
      for Name in $TryAgain
      do uucp:c/uucico -s$Name
      sleep 5 ; Resp=$(LogChkr)
      if [ "$Resp"="FAILED" ] then echo $Name >> tmp:Failed
      else
         while [ -f uuspool:D.* -o -f uuspool:X.* ]
         do sleep 20
         done
      fi
      done
   done
   setenv Dialer "OFF"
fi

