From b4fb94963a0a67bc974bcb0e240a5a63f8e854d2 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 13 Oct 2021 09:40:33 +0200 Subject: [PATCH] Add a timeout to avoid infinite connection --- bash_quote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_quote b/bash_quote index 912c4ff..9c3c86c 100755 --- a/bash_quote +++ b/bash_quote @@ -3,7 +3,7 @@ # Description: Get a quot from http://danstonchat.com if [ $(command -v lynx) ]; then - lynx --dump --display_charset=utf8 http://danstonchat.com/random0.html | awk '$0~".*Betamod" && $0!~"Score" { getline; while ($0!~"Score") { print $0; getline;}; exit }' + lynx -connect_timeout=2 --dump --display_charset=utf8 http://danstonchat.com/random0.html | awk '$0~".*Betamod" && $0!~"Score" { getline; while ($0!~"Score") { print $0; getline;}; exit }' else printf '%b' "Please install lynx package.\n" fi