mirror of https://github.com/dirtbags/moth.git
avoid duplicates in points.log
This commit is contained in:
parent
0d30360bbf
commit
09f361e887
|
@ -4,8 +4,10 @@ fn=$2/$3
|
||||||
POINTS=/var/lib/ctf/points.log
|
POINTS=/var/lib/ctf/points.log
|
||||||
SCOREBOARD=/var/www/scoreboard.html
|
SCOREBOARD=/var/www/scoreboard.html
|
||||||
|
|
||||||
cat $fn >> $POINTS || break
|
# Only do this if this score hasn't yet been recorded
|
||||||
rm $fn
|
if ! cut -d' ' -f2- $POINTS | grep -Fqx "$(cut -d' ' -f2- $fn)"; then
|
||||||
|
cat $fn >> $POINTS && rm $fn
|
||||||
|
fi
|
||||||
|
|
||||||
# Render scoreboard
|
# Render scoreboard
|
||||||
if [ $POINTS -nt $SCOREBOARD ]; then
|
if [ $POINTS -nt $SCOREBOARD ]; then
|
||||||
|
|
Loading…
Reference in New Issue