mirror of https://github.com/dirtbags/moth.git
35 lines
556 B
Bash
Executable File
35 lines
556 B
Bash
Executable File
#! /bin/sh
|
|
|
|
cd /var/lib/ctf/teams/names
|
|
|
|
escape () {
|
|
sed 's/&/\&/g;s/</\</g;s/>/\>/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
|
|
<p>Use your team's token to claim points.</p>
|
|
</body>
|
|
</html>
|
|
EOF |