autoupdater: Timeout for wget.
Added a 120 second timeout for wget to prevent it from stalling forever.
This commit is contained in:
parent
bd024a42c9
commit
ef6b4675d6
|
@ -125,7 +125,7 @@ local function read_manifest(mirror)
|
||||||
|
|
||||||
-- Read all lines from the manifest
|
-- Read all lines from the manifest
|
||||||
-- The upper part is saves to lines, the lower part to sigs
|
-- The upper part is saves to lines, the lower part to sigs
|
||||||
for line in io.popen(string.format("wget -O- '%s/%s.manifest'", mirror, branch.name), 'r'):lines() do
|
for line in io.popen(string.format("wget -T 120 -O- '%s/%s.manifest'", mirror, branch.name), 'r'):lines() do
|
||||||
if not sep then
|
if not sep then
|
||||||
if line == '---' then
|
if line == '---' then
|
||||||
sep = true
|
sep = true
|
||||||
|
@ -188,7 +188,7 @@ end
|
||||||
|
|
||||||
-- Downloads the firmware image from a mirror to a given output file
|
-- Downloads the firmware image from a mirror to a given output file
|
||||||
local function fetch_firmware(mirror, filename, output)
|
local function fetch_firmware(mirror, filename, output)
|
||||||
if os.execute(string.format("wget -O '%s' '%s/%s'", output, mirror, filename)) ~= 0 then
|
if os.execute(string.format("wget -T 120 -O '%s' '%s/%s'", output, mirror, filename)) ~= 0 then
|
||||||
io.stderr:write('Error downloading the image from ' .. mirror .. '\n')
|
io.stderr:write('Error downloading the image from ' .. mirror .. '\n')
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue