Add a timeout to avoid infinite connection

This commit is contained in:
gardouille 2021-10-13 09:40:33 +02:00
parent 0b627cc192
commit b4fb94963a
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 1 additions and 1 deletions

View File

@ -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