mirror of https://github.com/dirtbags/moth.git
Look for "until" file to disable contest by time
This commit is contained in:
parent
93c0939f3a
commit
10b4723d9f
11
bin/once
11
bin/once
|
@ -17,6 +17,17 @@ if [ -f state/disabled ]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
# Are we stopping at a certain time?
|
||||
if [ -f state/until ]; then
|
||||
read -r until < state/until
|
||||
when=$(date -d "$until" +%s)
|
||||
now=$(date +%s)
|
||||
if [ $now -ge $when ]; then
|
||||
log "End time reached; doing nothing"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
# Reset to initial state?
|
||||
if [ ! -f state/initialized ]; then
|
||||
log "Resetting contest state"
|
||||
|
|
Loading…
Reference in New Issue