#!/bin/sh
#CCCP script by hampa@chello.se
#this script will connect to all hubs and do a search query

#only hubs with atleast minusers in
minusers=450

nick="where_is_I"
searchquery="*rzr-w3c*1"
#save the quereys here
logfile="ms.log" 
echo "start" > $logfile

#internal
s4='$4'
s2='$2'

hublist=`hublist | awk -F\| "{if($s4>$minusers) print $s2}"`

#dctc -n $nick -o 99999999 -x -g macgyvers.evildc.net & 

cccp -r FOLLOWFORCE

for hub in $hublist
do
	echo ---connecting to $hub
	cccp -O -r "GOTO $hub"
	sleep 20 
	cccp -H $hub -s "$searchquery" >> $logfile 
	sleep 10
done
