moth/packages/mcp/service/pointsd/pointsd

15 lines
276 B
Bash
Executable File

#! /bin/sh
fn=$2/$3
POINTS=/var/lib/ctf/points.log
SCOREBOARD=/var/www/scoreboard.html
cat $fn >> $POINTS || break
rm $fn
# Render scoreboard
if [ $POINTS -nt $SCOREBOARD ]; then
/opt/mcp/bin/scoreboard < $POINTS > $SCOREBOARD.new && mv $SCOREBOARD.new $SCOREBOARD
fi