From bdd4db2df98f62ad7005847824c7b51f10d7438e Mon Sep 17 00:00:00 2001 From: nervuri Date: Fri, 4 Jun 2021 11:22:35 +0000 Subject: [PATCH] reduced number of retries by 1 --- get-certs.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/get-certs.sh b/get-certs.sh index 5b00847..49740e6 100755 --- a/get-certs.sh +++ b/get-certs.sh @@ -33,18 +33,11 @@ fetch_cert() ( response=$($timeout $torsocks openssl s_client -connect "$hp" /dev/null \ | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') - # If no response, try again. - if [ -z "$response" ]; then + # If no response and Tor was not used, try again. + if [ -z "$response" ] && [ -z "$torsocks" ]; then sleep 5 - response=$($timeout $torsocks openssl s_client -connect "$hp" /dev/null \ + response=$($timeout openssl s_client -connect "$hp" /dev/null \ | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') - - # If still no response and Tor was not used, try one last time. - if [ -z "$response" ] && [ -z "$torsocks" ]; then - sleep 10 - response=$($timeout openssl s_client -connect "$hp" /dev/null \ - | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') - fi fi echo "$response"