#!/bin/bash #Copyright 2002 William Stearns #Released under the GPL. if [ -z "$1" ]; then echo "Usage: $0 Filename_to_pull_raw_hashes_from" echo Exiting. exit 1 fi HashFile="${1}" HashCount=`cat "$HashFile" | wc -l` NumBlocks=$(( ($HashCount + 19) / 20 )) echo "Processing $HashCount lines in $HashFile in $NumBlocks blocks of 20" for X in `seq 1 $NumBlocks` ; do ( head --lines=$(( $X * 20 )) "$HashFile" | \ tail --lines=20 | \ sed -e 's/^/key:/' -e 's/$/\&action:lookup/' ; echo '.' ) | \ nc localhost 2702 done cat "$HashFile" | \ ( sed -e 's/^/key:/' -e 's/$/\&action:lookup/' ; echo '.' ) | \ nc localhost 2702