Add new-contest script

This commit is contained in:
Neale Pickett 2009-10-07 11:10:18 -06:00
parent 4f3c7190d4
commit 0f2b521279
2 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,7 @@ target: $(PYC)
$(INSTALL) -d $(DESTDIR)/usr/sbin
$(INSTALL) ctfd.py $(DESTDIR)/usr/sbin
$(INSTALL) new-contest $(DESTDIR)/usr/sbin
$(INSTALL) -d $(WWWDIR)
$(INSTALL) index.html intro.html ctf.css grunge.png $(WWWDIR)

18
new-contest Executable file
View File

@ -0,0 +1,18 @@
#! /bin/sh -e
ctime () {
stat -c %z $1 | awk '{ print $1; }'
}
rotate () {
mv $1 $1.$(ctime $1)
}
rotate /var/lib/ctf/puzzler.dat
rotate /var/lib/ctf/scores.dat
rotate /var/lib/ctf/passwd
rm -f /var/lib/ctf/flags/* || true
echo "Things you may want to tweak:"
find /var/lib/ctf/disabled
find /var/lib/kevin/tokens