mirror of https://github.com/dirtbags/moth.git
Fix permissions, make separate log file for claim
Whups :)
This commit is contained in:
parent
8e25c9f074
commit
ea1653cf03
|
@ -13,11 +13,18 @@ SCOREBOARD=$WWW/scoreboard.html
|
|||
PUZZLES=$WWW/puzzles.html
|
||||
TEAMS=$WWW/teams.html
|
||||
|
||||
mkdir -p $NEWPOINTS $STATE/teams/names $STATE/teams/colors
|
||||
touch $POINTS
|
||||
install -u ctf -m 0644 /dev/null $STATE/tokens.db
|
||||
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
|
||||
$BIN/scoreboard < $POINTS > $SCOREBOARD
|
||||
done
|
||||
fi
|
||||
|
||||
while true; do
|
||||
start=$(date +%s)
|
||||
|
@ -32,20 +39,17 @@ while true; do
|
|||
|
||||
# Render scoreboard
|
||||
if [ $POINTS -nt $SCOREBOARD ]; then
|
||||
$BIN/scoreboard < $POINTS > $SCOREBOARD.new
|
||||
mv $SCOREBOARD.new $SCOREBOARD
|
||||
$BIN/scoreboard < $POINTS > $SCOREBOARD.new && mv $SCOREBOARD.new $SCOREBOARD
|
||||
fi
|
||||
|
||||
# Render puzzles list
|
||||
if [ $STATE/puzzler.db -nt $PUZZLES ]; then
|
||||
$WWW/puzzles.cgi > $PUZZLES.new
|
||||
mv $PUZZLES.new $PUZZLES
|
||||
$WWW/puzzles.cgi > $PUZZLES.new && mv $PUZZLES.new $PUZZLES
|
||||
fi
|
||||
|
||||
# Render team names
|
||||
if [ $STATE/teams/names -nt $TEAMS ]; then
|
||||
$BIN/teams.sh > $TEAMS.new
|
||||
mv $TEAMS.new $TEAMS
|
||||
$BIN/teams.sh > $TEAMS.new && mv $TEAMS.new $TEAMS
|
||||
fi
|
||||
|
||||
now=$(date +%s)
|
||||
|
|
|
@ -69,7 +69,7 @@ main(int argc, char *argv[])
|
|||
my_snprintf(line, sizeof(line),
|
||||
"%s %s", team, token);
|
||||
award_and_log_uniquely(team, category, 1,
|
||||
state_path("tokens.db"), line);
|
||||
state_path("claim.db"), line);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue