put tanks back in

This commit is contained in:
Neale Pickett 2011-11-05 14:27:56 -06:00
parent 5f71708a87
commit f7c069cc72
3 changed files with 1450 additions and 7 deletions

View File

@ -3,6 +3,7 @@
d=/var/lib/ctf/tanks
p=$d/players
w=/var/www/tanks
log=$d/winners.log
summary () {
cat <<EOF
@ -40,9 +41,8 @@ EOF
}
while true; do
# Make sure all teams exist
KEY='Too much cheese.' arc4 < /var/lib/ctf/teams.txt | \
while read hash; do
for dn in /var/lib/ctf/teams/names/*; do
hash=${dn##*/}
install -o ctf -d $p/$hash
done
@ -99,12 +99,13 @@ EOF
</html>
EOF
# Get a token and add it to the redemption log
nc 10.0.0.2 1 -e /opt/ctfbase/bin/tokencli tanks ./category.key 3> $tfn
k=$(cat $tfn)
winner.awk $rfn | while read winner; do
hash=$(basename $winner)
echo "Round $next winner: $hash"
echo "Round $next winner: $hash" >> $log
nwinners=$(wc -l $log)
# Read a token
k=$(sed -n ${nwinners}p /opt/tanks/tokens.txt)
# XXX: pull this out into another daemon
# XXX: this puts the token in /proc/self/cmdline

View File

@ -21,6 +21,8 @@ tanks-install: tanks-build
cp $(TANKS_BUILDDIR)/rank.awk $(TANKS_PKGDIR)/bin
cp $(TANKS_BUILDDIR)/winner.awk $(TANKS_PKGDIR)/bin
cp packages/tanks/tokens.txt $(TANKS_PKGDIR)/
$(call COPYTREE, packages/tanks/html, $(TANKS_PKGDIR)/html)
cp packages/mcp/www/ctf.css $(TANKS_PKGDIR)/html/style.css
cp $(TANKS_BUILDDIR)/nav.html.inc $(TANKS_PKGDIR)/html

1440
packages/tanks/tokens.txt Normal file

File diff suppressed because it is too large Load Diff