Add a timeout to wget in helpers

This commit is contained in:
Alexandre Aubin 2020-05-03 17:37:33 +02:00
parent 71e30f5b1b
commit d29bf04e7c
2 changed files with 4 additions and 2 deletions

View file

@ -436,7 +436,8 @@ ynh_install_extra_repo () {
if [ -n "$key" ]
then
mkdir --parents "/etc/apt/trusted.gpg.d"
wget --quiet "$key" --output-document=- | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.gpg > /dev/null
# Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget)
wget --timeout 900 --quiet "$key" --output-document=- | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.gpg > /dev/null
fi
# Update the list of package with the new repo

View file

@ -144,7 +144,8 @@ ynh_setup_source () {
then # Use the local source file if it is present
cp $local_src $src_filename
else # If not, download the source
local out=`wget --no-verbose --output-document=$src_filename $src_url 2>&1` || ynh_print_err --message="$out"
# Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget)
local out=`wget --timeout 900 --no-verbose --output-document=$src_filename $src_url 2>&1` || ynh_print_err --message="$out"
fi
# Check the control sum