Revision 35870220
Added by Scott Ullrich over 18 years ago
- Do not close a buffer that has failed
- Automatically retry failed connection
etc/inc/pfsense-utils.inc | ||
---|---|---|
43 | 43 |
******/ |
44 | 44 |
function does_url_exist($url) { |
45 | 45 |
$fd = fopen("$url","r"); |
46 |
fclose($fd); |
|
47 | 46 |
if($fd) { |
47 |
fclose($fd); |
|
48 | 48 |
return true; |
49 | 49 |
} else { |
50 | 50 |
return false; |
etc/rc.initial_firmware_update | ||
---|---|---|
41 | 41 |
$status = does_url_exist($url); |
42 | 42 |
if($status) { |
43 | 43 |
echo "\nFetching file...\n"; |
44 |
exec("fetch -v -o /tmp/firmware.tgz \"$url\""); |
|
44 |
exec("fetch -w15 -a -v -o /tmp/firmware.tgz \"$url\"");
|
|
45 | 45 |
$status = does_url_exist("$url.md5"); |
46 | 46 |
if($status) { |
47 | 47 |
echo "\nFetching MD5...\n"; |
48 |
exec("fetch -v -o /tmp/firmware.tgz.md5 \"$url.md5\""); |
|
48 |
exec("fetch -w15 -a -v -o /tmp/firmware.tgz.md5 \"$url.md5\""); |
|
49 |
} else { |
|
50 |
echo "\n\nWARNING.\n"; |
|
51 |
echo "\nCould not locate a MD5 file. We cannot verify the download once its done.\n\n"; |
|
52 |
sleep(15); |
|
49 | 53 |
} |
50 | 54 |
if(file_exists("/tmp/firmware.tgz.md5")) { |
51 | 55 |
$source_md5 = trim(`cat /tmp/firmware.tgz.md5 | awk '{ print \$4 }'`,"\r"); |
Also available in: Unified diff