LARGE modus complete

This commit is contained in:
Marcus 2024-01-05 04:28:37 +01:00
parent ba5e40a603
commit 6f428d6a63

View file

@ -294,17 +294,19 @@ flootworker()
{ {
while true while true
do do
#FLOOTSRUNNING=$((FLOOTSRUNNING+1)) if [ $LARGE ]
#test $FLOOTSRUNNING -le $FLOOTFORKS && then
xymode
xymode echo "$OFFSET"
echo "$OFFSET for i in $(seq 0 $1 | shuf)
${LOL[$1]}" #> /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink" do
#FLOOTSRUNNING=$((FLOOTSRUNNING-1)) echo "${LOL[$i]}"
#echo "${LOL[$i]}" > /dev/tcp/127.0.0.1/1337 & done
else
#echo "worker $i PID ${LOLPID[$i]}" xymode
echo "$OFFSET
${LOL[$1]}"
fi
done > /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink" done > /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink"
} }
@ -324,25 +326,27 @@ loadLOL() {
# max 64k each one # max 64k each one
if [ $LARGE ] if [ $LARGE ]
then then
FIELDSIZE=64000 LOL_org="$(echo "$LOL_org" | shuf)"
LOLFIELDSIZE=64000
# line counter # line counter
L=1 L=1
LINES="$(echo "$LOL_org" | wc -l )" LINES="$(echo "$LOL_org" | wc -l )"
FIELDS="$(( ( $LINES / $FIELDSIZE ) ))" LOLFIELDS="$(( ( $LINES / $LOLFIELDSIZE ) ))"
message "LARGE mode: slicing ${YELLOW}${IMGFILE}${ENDCOLOR} - ${YELLOW}${LINES}${ENDCOLOR} into ${YELLOW}${FIELDS}${ENDCOLOR} fields" message "LARGE mode: slicing ${YELLOW}${IMGFILE}${ENDCOLOR} - ${YELLOW}${LINES}${ENDCOLOR} into ${YELLOW}${LOLFIELDS}${ENDCOLOR} fields"
i=0 i=0
while [ $i -le $FIELDS ] while [ $i -le $LOLFIELDS ]
do do
LN=$(($L+$FIELDSIZE+1)) LN=$(($L+$LOLFIELDSIZE+1))
message "field ${YELLOW}${i}${ENDCOLOR}, lines ${YELLOW}${L}${ENDCOLOR} - ${YELLOW}${LN}${ENDCOLOR}" message "field ${YELLOW}${i}${ENDCOLOR}, lines ${YELLOW}${L}${ENDCOLOR} - ${YELLOW}${LN}${ENDCOLOR}"
LOL[$i]="$(echo "$LOL_org" | sed -n "${L},$(($LN-1))p;${LN}q" )" LOL[$i]="$(echo "$LOL_org" | sed -n "${L},$(($LN-1))p;${LN}q" )"
L=$LN L=$LN
i=$(($i+1)) i=$(($i+1))
done done
echo STOP #~ echo "${LOL[14]}"
read #~ echo STOP
#~ read
else else
@ -439,28 +443,31 @@ floot() {
message "starting $FLOOTFORKS workers" message "starting $FLOOTFORKS workers"
if [ $LARGE ]
then while true
echo lol do
else for i in $(seq $FLOOTFORKS)
while true do
do #echo "check worker $i PID ${LOLPID[$i]} if running "
for i in $(seq $FLOOTFORKS) if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
do then
#echo "check worker $i PID ${LOLPID[$i]} if running " message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null #if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
then #then
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it" if [ $LARGE ]
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ] then
#then flootworker $LOLFIELDS &
LOLPID[$i]=$!
else
flootworker $i & flootworker $i &
LOLPID[$i]=$! LOLPID[$i]=$!
#fi fi
#fi
fi
done fi
done done
fi done
} }
case $1 in case $1 in