Fix permissions, make separate log file for claim

Whups :)
This commit is contained in:
Neale Pickett 2010-09-23 19:11:52 -06:00
parent 8e25c9f074
commit ea1653cf03
2 changed files with 14 additions and 10 deletions

View File

@ -13,11 +13,18 @@ SCOREBOARD=$WWW/scoreboard.html
PUZZLES=$WWW/puzzles.html PUZZLES=$WWW/puzzles.html
TEAMS=$WWW/teams.html TEAMS=$WWW/teams.html
mkdir -p $NEWPOINTS $STATE/teams/names $STATE/teams/colors install -u ctf -m 0644 /dev/null $STATE/tokens.db
touch $POINTS install -u ctf -m 0644 /dev/null $STATE/claim.db
install -u root -m 0644 /dev/null $POINTS
install -u ctf -d $NEWPOINTS
install -u root -d $STATE/teams/names
install -u root -d $STATE/teams/colors
install -u root -d $STATE/token.keys
if ! [ -f $SCOREBOARD ]; then if ! [ -f $SCOREBOARD ]; then
$BIN/scoreboard < $POINTS > $SCOREBOARD $BIN/scoreboard < $POINTS > $SCOREBOARD
done fi
while true; do while true; do
start=$(date +%s) start=$(date +%s)
@ -32,20 +39,17 @@ while true; do
# Render scoreboard # Render scoreboard
if [ $POINTS -nt $SCOREBOARD ]; then if [ $POINTS -nt $SCOREBOARD ]; then
$BIN/scoreboard < $POINTS > $SCOREBOARD.new $BIN/scoreboard < $POINTS > $SCOREBOARD.new && mv $SCOREBOARD.new $SCOREBOARD
mv $SCOREBOARD.new $SCOREBOARD
fi fi
# Render puzzles list # Render puzzles list
if [ $STATE/puzzler.db -nt $PUZZLES ]; then if [ $STATE/puzzler.db -nt $PUZZLES ]; then
$WWW/puzzles.cgi > $PUZZLES.new $WWW/puzzles.cgi > $PUZZLES.new && mv $PUZZLES.new $PUZZLES
mv $PUZZLES.new $PUZZLES
fi fi
# Render team names # Render team names
if [ $STATE/teams/names -nt $TEAMS ]; then if [ $STATE/teams/names -nt $TEAMS ]; then
$BIN/teams.sh > $TEAMS.new $BIN/teams.sh > $TEAMS.new && mv $TEAMS.new $TEAMS
mv $TEAMS.new $TEAMS
fi fi
now=$(date +%s) now=$(date +%s)

View File

@ -69,7 +69,7 @@ main(int argc, char *argv[])
my_snprintf(line, sizeof(line), my_snprintf(line, sizeof(line),
"%s %s", team, token); "%s %s", team, token);
award_and_log_uniquely(team, category, 1, award_and_log_uniquely(team, category, 1,
state_path("tokens.db"), line); state_path("claim.db"), line);
} }
} }