Add a timeout to avoid infinite connection
This commit is contained in:
parent
0b627cc192
commit
b4fb94963a
|
@ -3,7 +3,7 @@
|
||||||
# Description: Get a quot from http://danstonchat.com
|
# Description: Get a quot from http://danstonchat.com
|
||||||
|
|
||||||
if [ $(command -v lynx) ]; then
|
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
|
else
|
||||||
printf '%b' "Please install lynx package.\n"
|
printf '%b' "Please install lynx package.\n"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue