#!/bin/sh

if [ -d counters-off ]
then
	echo "Counters are already off."
	exit 0
fi

mkdir counters-off

for i in `find *.html aix ben duck madeline ppp -type f -name \*.html -print`
do
	if fgrep .dat $i >/dev/null 2>&1
	then
		mkdir -p counters-off/`dirname $i`
		sed '/\.dat/s/http.*\"/\/carlson\/2930.jpg"/' $i > counters-off/$i
	fi
done

cd counters-off

(
	top=`pwd`
	for j in `echo *.html`
	do
		if [ "$j" = "mediaone-index.html" ]
		then
			echo put $j index.html
		else
			echo put $j
		fi
	done
	for i in `find . -type d -print | cut -c2-`
	do
		echo "lcd "$top$i
		echo "cd "$i
		for j in `cd $top$i ; echo *.html`
		do
			echo put $j
		done
	done
	echo quit
) | ftp people.ne.mediaone.net
