mirror of https://github.com/dirtbags/moth.git
put tanks back in
This commit is contained in:
parent
5f71708a87
commit
f7c069cc72
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue