Merge pull request #972 from YunoHost/wget-timeout

Add a timeout to wget in helpers
This commit is contained in:
Bram 2020-05-04 14:23:36 +02:00 committed by GitHub
commit 42bc8c354a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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