Last active
April 24, 2019 12:51
-
-
Save thetekst/a2e048c5c412bf7e624de92332e3df31 to your computer and use it in GitHub Desktop.
Do curl request in loop with certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_PATH="$HOME/nginx/ssl/certificates" | |
PATH_CERT="$BASE_PATH/1.crt" | |
PATH_CERT_KEY="$BASE_PATH/1.key" | |
URL=https://localhost/v1/api/topic/favourites | |
#чтобы не писатать полный путь к утилите, например, /usr/bin/seq или /usr/bin/parallel или /usr/bin/curl | |
#экспортируем директиву в окружение | |
export MY_ENV="/usr/bin" | |
export PATH=$MY_ENV:$PATH | |
#выполняем в 1м потоке | |
# for value in {1..50000} | |
# do | |
# curl -k -s --cert "$PATH_CERT" --key "$PATH_CERT_KEY" "$URL" | |
# done | |
#выполняем параллельно, с помощью sudo apt install parallel | |
seq 50000 | parallel -n0 curl -k -s --cert "$PATH_CERT" --key "$PATH_CERT_KEY" "$URL" | |
# links2 | |
# links2 -ssl.certificates 0 -ssl.client-cert-crt "$PATH_CERT" -ssl.client-cert-key "$PATH_CERT_KEY" -force-html "$URL" | |
echo All done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment