Open iNoSec opened 5 years ago
Hello,
Sorry for taking so long to reply, I missed this. You are looking at the Gmail.sh module and the individual post. This is not where the threading is implemented. It is rather done within the main conformer.sh script.
This isn't the best implementation of threading, but I have a variable thread as you mentioned which is set by the user, I loop through the list with a counter incrementing and each post authentication is backgrounded until the counter = the number of threads the user picked. The batches of the posts finish the counter resets and the loop repeats.
for pass in $(cat $3); do
com=$((com+1));
...
elif [[ $(echo "$4" | tr '[:upper:]' '[:lower:]') == "gmail" ]]; then
POST_Gmail "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" &
...
fi
if [[ $com == $THREAD ]] ; then
wait $!;
com=0;
fi
sleep "$Sleep"s;
done
wait;
fi
fi
Hi, it is not an issue because i dont test it but can you explain how you implement thread?? because the only thing i see in the code is only assignement to t
hread=
with grep and cut which give the value to this variable but i dont see anything else wich make it really on, but in real there is no multithreading here, i dont know if thats make sense for you. to make it multithreaded you must add&
at the end of your POST variable like thisPOST=$(curl -u "$line":"$pass" --silent "https://mail.google.com/mail/feed/atom &");
or something like thatPOST=$(parallel -j "$(nproc)" curl -u "$line":"$pass" --silent "https://mail.google.com/mail/feed/atom");
which make it multithreaded so that will run available-processors Hope that makes sense for you, love bash scripting