summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-05-02 00:08:18 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-05-02 00:08:18 +0000
commit4cc6345ed7ff724f1d92b38220d75b7d73b46e42 (patch)
treedc5d3797d33d281187ffd20aa7dddd8ac9c3512b
parent9b5d2d24a3b27c0c543aea1b41400afd3a7d874d (diff)
downloadpfsense-4cc6345ed7ff724f1d92b38220d75b7d73b46e42.zip
pfsense-4cc6345ed7ff724f1d92b38220d75b7d73b46e42.tar.gz
* Do not close a buffer that has failed * Automatically retry failed connection
-rw-r--r--etc/inc/pfsense-utils.inc2
-rwxr-xr-xetc/rc.initial.firmware_update8
2 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index eaa4c2d..14f8b93 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -43,8 +43,8 @@
******/
function does_url_exist($url) {
$fd = fopen("$url","r");
- fclose($fd);
if($fd) {
+ fclose($fd);
return true;
} else {
return false;
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update
index 8bb6a7b..7e300ae 100755
--- a/etc/rc.initial.firmware_update
+++ b/etc/rc.initial.firmware_update
@@ -41,11 +41,15 @@ switch ($command) {
$status = does_url_exist($url);
if($status) {
echo "\nFetching file...\n";
- exec("fetch -v -o /tmp/firmware.tgz \"$url\"");
+ exec("fetch -w15 -a -v -o /tmp/firmware.tgz \"$url\"");
$status = does_url_exist("$url.md5");
if($status) {
echo "\nFetching MD5...\n";
- exec("fetch -v -o /tmp/firmware.tgz.md5 \"$url.md5\"");
+ exec("fetch -w15 -a -v -o /tmp/firmware.tgz.md5 \"$url.md5\"");
+ } else {
+ echo "\n\nWARNING.\n";
+ echo "\nCould not locate a MD5 file. We cannot verify the download once its done.\n\n";
+ sleep(15);
}
if(file_exists("/tmp/firmware.tgz.md5")) {
$source_md5 = trim(`cat /tmp/firmware.tgz.md5 | awk '{ print \$4 }'`,"\r");
OpenPOWER on IntegriCloud