#!/bin/sh -e

[ $# -ge 1 ] || exit 2

max=$1

count=1
bindir=`dirname $0`
running=`ps -o pid= -C foo -C wget | wc | awk '{print $1}'`
if [ $running -gt 0 ]; then
    echo "You still have $running foo or wget processes running"
    exit 1
fi
while [ $count -le $max ]; do
      webserver=dev${count}.chrism.d12.opera.com
      $bindir/foo $webserver "foo$count" &
      count=`expr $count + 1`
done
