increase timeouts in get-hosts.sh

This commit is contained in:
nervuri 2021-08-30 19:13:01 +00:00
parent a8bb016171
commit a86d7b467d
Signed by: nervuri
GPG Key ID: C4769EEA7BA61672
1 changed files with 4 additions and 4 deletions

View File

@ -16,14 +16,14 @@ if command -v agunua >/dev/null; then
# Using Agunua is more secure, because it does certificate pinning.
# The --insecure option just makes it accept certificates that are
# not signed by a (known) CA.
hosts1=$(agunua --insecure --binary --maximum-time 5 \
hosts1=$(agunua --insecure --binary --maximum-time 20 \
gemini://geminispace.info/known-hosts 2>/dev/null \
| grep "gemini://" | cut -d ' ' -f 3)
if [ -z "$hosts1" ]; then
>&2 echo "geminispace.info/known-hosts download failed."
exit 1
fi
hosts2=$(agunua --insecure --binary --maximum-time 5 \
hosts2=$(agunua --insecure --binary --maximum-time 20 \
gemini://gemini.bortzmeyer.org/software/lupa/lupa-capsules.txt 2>/dev/null)
if [ -z "$hosts2" ]; then
>&2 echo "lupa-capsules.txt download failed."
@ -32,14 +32,14 @@ if command -v agunua >/dev/null; then
else
# If Agunua is not installed, pipe the request into OpenSSL s_client.
hosts1=$(printf "gemini://geminispace.info/known-hosts\r\n" \
| timeout 5 openssl s_client -quiet -connect "geminispace.info:1965" 2>/dev/null \
| timeout 20 openssl s_client -quiet -connect "geminispace.info:1965" 2>/dev/null \
| grep "gemini://" | cut -d ' ' -f 3)
if [ -z "$hosts1" ]; then
>&2 echo "geminispace.info/known-hosts download failed."
exit 1
fi
hosts2=$(printf "gemini://gemini.bortzmeyer.org/software/lupa/lupa-capsules.txt\r\n" \
| timeout 5 openssl s_client -quiet -connect "gemini.bortzmeyer.org:1965" 2>/dev/null \
| timeout 20 openssl s_client -quiet -connect "gemini.bortzmeyer.org:1965" 2>/dev/null \
| tail -n +2)
if [ -z "$hosts2" ]; then
>&2 echo "lupa-capsules.txt download failed."