#!/bin/sh
#
# Matt's Grabber Thingy
#

cmd="ftp"
dir="/var/www/users/mklein/dilbert/"
u="http://www.geek.nl/pics/dilbert-arch/"
s=52
e=71

for i in `lynx $u --source | cut -c$s-$e`
do
	if [ `echo $i | grep gif` ] 
	then

		j=`echo "$i" | cut -c9-12`
		j=`echo "$j/"`
		echo "Testing '$dir$j$i'"
		if [ -s $dir$j$i ]
		then
			echo "Skipped $dir$j$i -- existed..";
		else
			echo "Grabbing $i";
			ftp -o $dir$j$i $u$i;
		fi
	fi
done

