#!/bin/sh
# update_moto, Boone, 04/26/02
# Build the moto.pdb file
#
# Modifications:
# 04/26/02 Boone      Initial coding
# 05/02/02 Boone      Additional URLs, make httrack work more slowly,
#                     send an MSIE user-agent string, command line option
#                     to choose new-build or update runs, cause plucker
#                     to set the no-backup flag in the pdb file (cuz it's
#                     huge and takes forever to back up)
# 12/13/03 Boone      New plucker version doesn't have a plucker-build
#                     command anymore %^&*()
# 05/11/04 Boone      URL scrubbing;
#                     gone, local mirror substituted:
#                     http://www.cdi2.com/build_it/index.html-ssi
# 05/18/05 Boone      More URL scrubbing; add IPv4-only option to httrack,
#                     since batlabs AAAA record breaks httrack on non-v6
#                     boxes
# End Modifications

	MODE=$1

	if [ X"$MODE" = Xskip ]
	then
		:
	elif [ X"$MODE" = Xnew ]
	then
		# Build the thing the first time
		httrack \
			http://www.open.org/~blenderm/syntorx/ \
			http://www.open.org/~blenderm/spectra/ \
			http://www.batlabs.com/index.html \
			http://www.brinkleyelectronics.com/ \
			http://home.xnet.com/~pakman/syntor/syntorx.htm \
			http://www.repeater-builder.com/rbtip/ \
			http://localhost/build_it/ \
			http://www.seits.org/repeater/repeater.htm \
			http://www.seits.org/features/features.htm \
			http://www.seits.org/duplexer/duplexer.htm \
			http://www.seits.org/maps/maxar.htm \
			+http://www.batlabs.com/index.html \
			+http://www.repeater-builder.com/motorola/* \
			-z -a -p1 \
			-O "./motorola" -%v -w -c1 -V "sleep 1" -s0 -@i4 \
			-F "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"
	else
		# Update it after it's built once
		httrack \
			http://www.open.org/~blenderm/syntorx/ \
			http://www.open.org/~blenderm/spectra/ \
			http://www.batlabs.com/index.html \
			http://www.brinkleyelectronics.com/ \
			http://home.xnet.com/~pakman/syntor/syntorx.htm \
			http://www.repeater-builder.com/rbtip/ \
			http://localhost/build_it/ \
			http://www.seits.org/repeater/repeater.htm \
			http://www.seits.org/features/features.htm \
			http://www.seits.org/duplexer/duplexer.htm \
			http://www.seits.org/maps/maxar.htm \
			+http://www.batlabs.com/index.html \
			+http://www.repeater-builder.com/motorola/* \
			-z -a -p1 -@i4 \
			-O "./motorola" -%vw -c1 -V "sleep 1" -s0 -X0 --update \
			-F "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"
	fi

	/usr/lib/python2.3/site-packages/PyPlucker/Spider.py \
		-f moto -N moto -V1 -P. --noimages --stayonhost -M99 \
		--no-backup --compression=zlib \
		-H file:/root/Rdrb/radio/whacks/motorola/index.html
