Script to list teams

This commit is contained in:
Neale Pickett 2010-09-07 17:47:00 -06:00
parent 3c7a6e06c3
commit 2fe4123f87
1 changed files with 32 additions and 0 deletions

32
src/teams.sh Executable file
View File

@ -0,0 +1,32 @@
#! /bin/sh
escape () {
sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
}
title='Teams'
cat <<EOF
<!DOCTYPE html>
<html>
<head>
<title>$title</title>
<link rel="stylesheet" href="ctf.css" type="text/css">
</head>
<body>
<h1>$title</h1>
EOF
echo "<table>"
echo "<tr><th>Team Name</th><th>Token</th></tr>"
for i in ??????; do
echo "<tr><td>"
escape < $i
echo "</td><td><samp>$i</samp></td></tr>"
done
echo "</table>"
cat <<EOF
</body>
</html>
EOF