server/launch.sh

34 lines
475 B
Bash
Raw Normal View History

2013-12-14 05:11:14 +00:00
#!/bin/sh
2014-01-19 16:49:07 +00:00
rm -f /tmp/stop
2013-12-14 05:11:14 +00:00
cd `dirname "$0"`
if [ "$UID" = "0" ]
then
SCRIPT=`pwd`/`basename "$0"`
su -c "sh $SCRIPT" synchro
exit $?
fi
touch ./logs/checks.log
tail -f ./logs/checks.log &
2014-01-19 16:49:07 +00:00
TMPF=`mktemp`
tail -f "$TMPF" | ./gen_site.pl -d -o ./out/ &
2013-12-14 05:11:14 +00:00
2014-01-14 15:14:31 +00:00
while ! [ -f /tmp/stop ];
2013-12-14 05:11:14 +00:00
do
2014-01-19 16:49:07 +00:00
./synchro.sh delete > /dev/null
2013-12-14 05:11:14 +00:00
if [ `ls submission | wc -l` -gt 1 ]
then
2014-01-19 16:49:07 +00:00
./check.pl 2>> ./logs/checks.log >> "$TMPF"
2013-12-14 05:11:14 +00:00
else
sleep 1
fi
done
2014-01-19 16:49:07 +00:00
rm -rf "$TMPF"