intermédiaire - no use

This commit is contained in:
2018-10-06 09:56:23 +02:00
parent ebf5b0d648
commit e121c6f6dd
11 changed files with 1440 additions and 0 deletions

36
methode/line/robot.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
METHODE=line
flag=$TMP_PATH/${METHODE}_bot.flag
date=`date +%Y%m%d0000`
if [ -f $flag ];
then
echo "$METHODE_bot is already running !"
exit 0
fi
touch $flag
cd $APPS_PATH/methode/$METHODE
for BLOCK in `awk '{print $2}' $DATA_PATH/block_list.txt`
do
if [ ! -f $DATA_PATH/$METHODE/$BLOCK.png ]
then
php robot.php $BLOCK $(( RANDOM % 6))
fi
BNAME=`grep $BLOCK $DATA_PATH/block_list.txt | awk '{print $1}'`
if [ "$BNAME" == "LAST" ]
then
touch $DATA_PATH/$METHODE/$BLOCK.png
else
touch -t $date $DATA_PATH/$METHODE/$BLOCK.png
fi
rm -f $DATA_PATH/hasard/$BLOCK.png
ln $DATA_PATH/last/$BLOCK.png $DATA_PATH/$METHODE/$BLOCK.png
ln $DATA_PATH/last/$BLOCK.png $DATA_PATH/hasard/$BLOCK.png
done
rm -f $flag