challenge: Fix disk bonus when RANDOM <= 9

This commit is contained in:
nemunaire 2023-02-21 01:46:54 +01:00
parent 42432b45b5
commit b594a05416

View File

@ -85,8 +85,8 @@ mount "${LOOPDEV}p1" /mnt > /dev/null 2> /dev/null
N1=$((29 - $RANDOM % 25)) N1=$((29 - $RANDOM % 25))
N2=$((3 + $RANDOM % 25)) N2=$((3 + $RANDOM % 25))
{ {
echo -n $N1 printf %02d $N1
echo -n $N2 printf %02d $N2
echo -n ${USER_PKEY:$N1:$N2} | sha512sum | cut -d " " -f 1 echo -n ${USER_PKEY:$N1:$N2} | sha512sum | cut -d " " -f 1
} > /mnt/bonus2 } > /mnt/bonus2