#!/bin/sh TIMEOUT=30 RETRY=0 DOWNLOAD=./ AGENT="Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0)" if [ $# -lt 1 ]; then echo "Usage: $0 listfile|URL" exit 1 fi if [ -f $1 ]; then URL=`egrep -v '^#' $1` else if [ "`echo $1 | egrep '^http'`" = "" ]; then echo "file not found." exit 1 else URL=$1 fi fi for u in $URL do LOG=$DOWNLOAD`echo $u | awk -F/ '{print $NF}'`.log echo -n "$u " wget $u -b -c -o $LOG -t $RETRY -T $TIMEOUT -P $DOWNLOAD -U "$AGENT" done exit 0