From caebe446281cfb33711fb20cb5206642ee2894a7 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Mar 2021 12:46:29 +0100 Subject: [PATCH] Captcha : sentences were randomly mixed up, now resolved --- captcha/captcha.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/captcha/captcha.sh b/captcha/captcha.sh index ce87eac..93acd8f 100755 --- a/captcha/captcha.sh +++ b/captcha/captcha.sh @@ -108,14 +108,15 @@ SOMME() get_random RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]})) -INSTRUCTIONS=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 1) -INSTRUCTIONS2=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 3) -TEXT=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})" | cut -d "|" -f 2) +INSTRUCTIONS0=$(echo "$(${TRANSFORMATIONS[$RAND_INDEX]})") +INSTRUCTIONS1=$(echo $INSTRUCTIONS0 | cut -d "|" -f 1) +INSTRUCTIONS2=$(echo $INSTRUCTIONS0 | cut -d "|" -f 3) +TEXT=$(echo $INSTRUCTIONS0 | cut -d "|" -f 2) convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ - -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ + -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS1" \ -font Helvetica-Bold -annotate "0x0+0+22" "\n $TEXT" \ -font Helvetica-Narrow -annotate "0x0+0+44" "\n $INSTRUCTIONS2" \ -roll +$ROLL_X+0 \ @@ -126,7 +127,7 @@ convert -size 300x70 xc:none -pointsize 20 \ convert -size 300x70 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ - -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS" \ + -font Helvetica-Narrow -annotate "0x0+0+0" "\n $INSTRUCTIONS1" \ -font Helvetica-Bold -annotate "0x0+0+22" "\n $TEXT" \ -font Helvetica-Narrow -annotate "0x0+0+44" "\n $INSTRUCTIONS2" \ -roll +$ROLL_X+0 \