moth/packages/mcp/bin/teams.sh

39 lines
622 B
Bash
Raw Normal View History

2010-09-07 17:47:00 -06:00
#! /bin/sh
2010-09-23 23:27:14 -06:00
cd ${CTF_BASE:-/var/lib/ctf}/teams/names
2010-09-23 18:23:00 -06:00
2010-09-07 17:47:00 -06:00
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>"
2010-09-24 22:28:40 -06:00
echo "<tr><th>Team</th><th>ID</th></tr>"
2010-09-23 23:27:14 -06:00
for i in *; do
2010-09-07 17:47:00 -06:00
echo "<tr><td>"
escape < $i
echo "</td><td><samp>$i</samp></td></tr>"
done
echo "</table>"
cat <<EOF
2010-09-24 22:28:40 -06:00
<p>
Team names are only used on this page and the scoreboard.
Use your team ID to claim points.
</p>
2010-09-07 17:47:00 -06:00
</body>
</html>
2010-09-23 23:27:14 -06:00
EOF