server/launch.sh

34 lines
475 B
Bash
Executable File

#!/bin/sh
rm -f /tmp/stop
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 &
TMPF=`mktemp`
tail -f "$TMPF" | ./gen_site.pl -d -o ./out/ &
while ! [ -f /tmp/stop ];
do
./synchro.sh delete > /dev/null
if [ `ls submission | wc -l` -gt 1 ]
then
./check.pl 2>> ./logs/checks.log >> "$TMPF"
else
sleep 1
fi
done
rm -rf "$TMPF"