Use bash for Debian compat
This commit is contained in:
parent
89c2c4a2dc
commit
5e89d9d31e
7 changed files with 50 additions and 6 deletions
42
launch_local.sh
Executable file
42
launch_local.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script does all actions in backend local environment
|
||||
|
||||
rm -f /tmp/stop
|
||||
cd `dirname "$0"`
|
||||
|
||||
source config.sh
|
||||
|
||||
#if [ "$UID" = "0" ]
|
||||
#then
|
||||
# SCRIPT=`pwd`/`basename "$0"`
|
||||
# su -c "sh $SCRIPT" "$SYNCHRO_USER"
|
||||
# exit $?
|
||||
#fi
|
||||
|
||||
mkdir -p ./logs
|
||||
|
||||
touch ./logs/checks.log
|
||||
tail -f ./logs/checks.log &
|
||||
KP1=$!
|
||||
|
||||
TMPF=`mktemp`
|
||||
|
||||
tail -f "$TMPF" | ./gen_site.pl -d -s /tmp/test.sock -bt /challenge/ -ba /challenge-admin/ -o ./out &
|
||||
KP2=$!
|
||||
|
||||
while ! [ -f /tmp/stop ];
|
||||
do
|
||||
if [ `ls submission | wc -l` -gt 1 ]
|
||||
then
|
||||
./clear_cache.sh top
|
||||
./check.pl 2>> ./logs/checks.log >> "$TMPF"
|
||||
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
|
||||
kill -9 $KP1 $KP2
|
||||
|
||||
rm -rf "$TMPF"
|
||||
Reference in a new issue