packages feed

SoccerFun-0.4.3: tournament/makeAll.sh

#!/bin/sh

echo '<html><head><title>SoccerFun Tournament</title></head><body><table>' > out

echo "<tr>" >> out
for i in teams/*; do
	echo "<td>`basename $i`</td>" >> out
done
echo "<td></td>" >> out
echo "</tr>" >> out

for i in teams/*; do
	for j in teams/*; do
		make TEAM1=`basename $i` TEAM2=`basename $j` record
	done;
done

for i in teams/*; do
	echo "<tr>" >> out
	for j in teams/*; do
		game=`basename $i`-`basename $j`
		echo "<td>" >> out
		if [ `stat -c%s "tapes/$game.log"` -lt 10 ]; then
			[ -s tapes/$game.sft ] && echo "<a href=\"$game.sft\">" >> out
			cat "tapes/$game.log" >> out
			[ -s tapes/$game.sft ] && echo "</a>" >> out
		else
			echo "<a href=\"$game.log\">error</a>" >> out
		fi
		echo "</td>" >> out
	done;
	echo "<td>`basename $j`</td>" >> out
	echo "</tr>" >> out
done

echo '</table></title></head><body><table>' >> out

mv out tapes/index.html