From 0f2b521279d4e8f96c452095cbf02415c700f5db Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 7 Oct 2009 11:10:18 -0600 Subject: [PATCH] Add new-contest script --- Makefile | 1 + new-contest | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 new-contest diff --git a/Makefile b/Makefile index 96254d0..7b71e7a 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/new-contest b/new-contest new file mode 100755 index 0000000..2325e44 --- /dev/null +++ b/new-contest @@ -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