#!/bin/sh

wget -q -r http://localhost:8001
# Give yaws some time to write out its report.log file
count=10
while [ $count -gt 0 ]; do
    # check it report.log
    # count lines to work around grep exit status portability issues
    total=`cat logs/report.log | grep -v www/arg.yaws | \
        grep -v www/arg2.yaws | grep -v ^=ERROR | grep ERROR 2>&1 | wc -l`
    [ "$total" -eq 0 ] || exit 1
    count=`expr $count - 1`
done
exit 0
