hashes tient compte du cache

This commit is contained in:
2018-12-29 09:56:36 +01:00
parent b1ed2170f6
commit 3c7acc8443
12 changed files with 53 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
lescript=`basename $0 .sh`
lescript=blocks2
#
# TOOLS
@@ -39,6 +39,8 @@ then
fi
while IFS='' read -r line || [[ -n "$line" ]]; do
NAME=`echo $line | awk '{print $1}'`
BLOCK=`echo $line | awk '{print $2}'`
HEIGHT=`echo $line | awk '{print $3}'`
NBTX=`echo $line | awk '{print $4}'`
@@ -57,9 +59,8 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
#
# CHOISIR UNE METHODE2 AU HASARD
#
for METHODE in `ls $APPS_PATH/methode2 | grep -v robot | shuf`
for METHODE in `ls $APPS_PATH/methode2 | grep -v robot | shuf | head -n 1`
do
echo $METHODE
if [ ! -d $DATA_PATH/$METHODE ]
then
mkdir -p $DATA_PATH/$METHODE
@@ -69,14 +70,19 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
then
cd $APPS_PATH/methode2
php robot.php $METHODE $BLOCK $((RANDOM % 6)) $2
if [ "$2" == "" ];
then
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
fi
cp $DATA_PATH/last/$BLOCK.png $DATA_PATH/$METHODE/$BLOCK.png
fi
done
if [ ! -f $DATA_PATH/hasard/$BLOCK.png ]
then
cp $DATA_PATH/last/$BLOCK.png $DATA_PATH/hasard/$BLOCK.png
fi
touch $DATA_PATH/hasard/$BLOCK.png
rm -f $flag
done < $DATA_PATH/block_list.txt
#

View File

@@ -56,7 +56,7 @@ fi
#
# TWEET
#
TWEET=30
TWEET=8
if [ $((MINUTE % $TWEET)) -eq 0 ]
then
debug "send a TWEET"