put tanks back in

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

View File

@ -3,6 +3,7 @@
d=/var/lib/ctf/tanks d=/var/lib/ctf/tanks
p=$d/players p=$d/players
w=/var/www/tanks w=/var/www/tanks
log=$d/winners.log
summary () { summary () {
cat <<EOF cat <<EOF
@ -40,9 +41,8 @@ EOF
} }
while true; do while true; do
# Make sure all teams exist for dn in /var/lib/ctf/teams/names/*; do
KEY='Too much cheese.' arc4 < /var/lib/ctf/teams.txt | \ hash=${dn##*/}
while read hash; do
install -o ctf -d $p/$hash install -o ctf -d $p/$hash
done done
@ -99,12 +99,13 @@ EOF
</html> </html>
EOF 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 winner.awk $rfn | while read winner; do
hash=$(basename $winner) 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: pull this out into another daemon
# XXX: this puts the token in /proc/self/cmdline # 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)/rank.awk $(TANKS_PKGDIR)/bin
cp $(TANKS_BUILDDIR)/winner.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) $(call COPYTREE, packages/tanks/html, $(TANKS_PKGDIR)/html)
cp packages/mcp/www/ctf.css $(TANKS_PKGDIR)/html/style.css cp packages/mcp/www/ctf.css $(TANKS_PKGDIR)/html/style.css
cp $(TANKS_BUILDDIR)/nav.html.inc $(TANKS_PKGDIR)/html 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