diff options
-rw-r--r-- | etc/inc/pfsense-utils.inc | 2 | ||||
-rwxr-xr-x | etc/rc.initial.firmware_update | 8 |
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"); |